If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Some help with COUNTIF

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-08-06, 18:18
Big John Big John is offline
Registered User
 
Join Date: Jan 2004
Location: Berkshire, UK
Posts: 22
Some help with COUNTIF

Hi all,

I have a spreadsheet with several tabs. One is a sheet called "Leads" containing my primary information and the other tabs are reports that reference the "Leads" sheet - the one in question is called "Source Detail".

I have put the following function in a cell in the "Source Detail" tab

=countif(Leads!d:d,"Unknown")

And it works.

However, I have another factor to incorporate into this function - and I can't work it out.

I want to return the above 'countif' statement, but only where the "Unknown" in column D sits alongside "Advert" in column C.

Is there a 'where' statement or similar that will help me achieve this?

So to recap as best I can, in simple terms:

I want to count all instances of "Unknown" in column D of the Leads sheet where it is next to "Advert" in column C.

I hope this makes sense and someone can help me.

All the best,

John
Reply With Quote
  #2 (permalink)  
Old 12-08-06, 19:31
shades shades is offline
Registered User
 
Join Date: Oct 2003
Posts: 1,091
Howdy. You have to use SUMPRODUCT. It functions like COUNTIF with multiple conditions, only you can't reference the column as a whole like with COUNTIF.

=SUMPRODUCT((Leads!$D$2:$D$100="Unknown")*(Leads!$ D$2:$D$100="Advert"))
__________________
old, slow, and confused
but at least I'm inconsistent!

Rich
(retired Excel 2003 user, 3/28/2008)

How to ask a question on forums
Reply With Quote
  #3 (permalink)  
Old 12-08-06, 19:54
Big John Big John is offline
Registered User
 
Join Date: Jan 2004
Location: Berkshire, UK
Posts: 22
Thanks Shades.

That worked perfectly.

Do you know if you can use wildcards in this function? It didn't seem to work when I just tried it.

All the best.

John
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
Pingbacks are On
Refbacks are On