Welcome to Tech Support Forum home to more then 136,000 problems solved. Issues have included: Spyware, Malware, Virus Issues, Windows, Microsoft, Linux, Networking, Security, Hardware, and Gaming Getting your problem solved is as easy as:
1. Registering for a free account
2. Asking your question
3. Receiving an answer

Registered members:
* Get free support
* Communicate privately with other members (PM).
* Removal of this message
* See fewer ads.
* And much more..

 



Want to know how to post a question? click here Having problems with spyware and pop-ups? First Steps
Go Back   Tech Support Forum > Microsoft Support > Microsoft Office support
User Name
Password
Site Map Register Donate Rules Blogs Mark Forums Read


Microsoft Office support MS Office support forum

Reply
 
LinkBack Thread Tools
Old 09-22-2009, 08:38 AM   #1 (permalink)
Registered User
 
Join Date: Sep 2009
Posts: 5
OS: windows xp


Thumbs Up two text conditions with COUNTIF in office 2003

I have a summary worksheet linked to other worksheets in the same workbook. I am using the following to count events actioned by a person with the surname of "knight". =COUNTIF(sa_advisor_LAST_NAME,"knight")
It works well as it is but I have a problem:
1. how do I get it to check for last name in column b and first name in column a (needed if we have the same surname duplication).? I can't work out how to have 2 conditions in a countif but cant find another function that would work instead.

Last edited by carrach; 09-22-2009 at 08:42 AM.
carrach is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Important Information
Join the #1 Tech Support Forum Today - It's Totally Free!

TechSupportForum.com is a leading support website for your computer needs. We offer free, friendly and personalized computer support. Why pay to have your computer fixed when you can do it for free.

Join TechSupportforum.com Today - Click Here

Old 09-22-2009, 10:06 AM   #2 (permalink)
Registered User
 
Elkar's Avatar
 
Join Date: Mar 2008
Posts: 69
OS: XP SP2, Vista


Re: two text conditions with COUNTIF in office 2003

For multiple conditions, use SUMPRODUCT instead.

=SUMPRODUCT(--(sa_advisor_LAST_NAME="Knight"),--(sa_advisor_FIRST_NAME="Michael"))

HTH
Elkar
Elkar is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 09-23-2009, 02:22 AM   #3 (permalink)
Registered User
 
Join Date: Sep 2009
Posts: 5
OS: windows xp


Cry Re: two text conditions with COUNTIF in office 2003

Thank you Elkar, but that doesn't work I'm afraid. I've not used SUMPRODUCT before, can you explain the function and what the hyphens are for.
regards
carrach is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 09-23-2009, 04:16 AM   #4 (permalink)
Registered User
 
Elkar's Avatar
 
Join Date: Mar 2008
Posts: 69
OS: XP SP2, Vista


Re: two text conditions with COUNTIF in office 2003

SUMPRODUCT takes multiple ranges (of the same size) and multiplies the 1st value in each range, then the second value in each range, third etc... Then, it adds each of those results together to get a total. So, for example:

LAST_NAME
Knight
Knight

FIRST_NAME
Michael
Bill

The first values (Knight, Michael). Since LAST_NAME="Knight" it returns 1 for True. And since FIRST_NAME="Michael", it returns another 1 for True. 1x1=1.

The Second values (Knight, Bill). Since LAST_NAME="Knight" it returns 1 for True. And since FIRST_NAME<>"Michael" it returns 0 for FALSE. 1x0=0.

Then it adds the results. 1+0=1. So, there is one set of data that satisfies both conditions.

The purpose of the hyphens is basically the same as multiplying by -1 twice. This is because SUMPRODUCT only works with numbers. So the TRUE/FALSE results are converted to 1 or 0.

It should work based on the example you provided. I tested it on an Excel 2003 workbook and it works for me. Make sure that the named ranges are spelled correctly and that the ranges are the same size.

HTH
Elkar
Elkar is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 09-24-2009, 02:14 AM   #5 (permalink)
Registered User
 
Join Date: Sep 2009
Posts: 5
OS: windows xp


Cry Re: two text conditions with COUNTIF in office 2003

Hi again
thank you for the reply, but I still can't get it to work & dont know enough to know why.
I've doctored the sheet (removed the sensitive information and unecessary sheets) and attached. As you can see I used the formulae for Hilary Green. The ones I also need to use it for are highlighted in purple.
I am grateful for your help.
regards
Attached Files
File Type: zip query.zip (28.2 KB, 2 views)
carrach is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 09-25-2009, 03:01 PM   #6 (permalink)
Registered User
 
Elkar's Avatar
 
Join Date: Mar 2008
Posts: 69
OS: XP SP2, Vista


Re: two text conditions with COUNTIF in office 2003

Ok, I see the problem. Your named ranges refer to entire columns (D:D and E:E). SUMPRODUCT can only be used with limited range values, not entire columns. If you adjust your named ranges to refer to cells D3:D999 instead of just D:D it should work. Repeat for each range. You can use whatever number you want for the ending value up to 65535.

HTH
Elkar
Elkar is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Old 09-28-2009, 03:48 AM   #7 (permalink)
Registered User
 
Join Date: Sep 2009
Posts: 5
OS: windows xp


Thumbs Up Re: two text conditions with COUNTIF in office 2003

Wow, today is a wonderful day!! Thank you so so so much. I have been fighting with this for so long but hadn't realised that it was something so simple. It works!!!
Thank you many times over.
regards
carrach is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -7. The time now is 01:27 AM.



Copyright 2001 - 2009, Tech Support Forum
Home Tips Plus | Outdoor Basecamp | Automotive Support Forum

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85