Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 86
Default Searching two columns against a specific criteria

Hi,
I have a range of data in A2:G30.
The cells in range A2:A30 have either 'yes' or 'no' as text in the cells.
The cells in range D2:D30 have either 'David', 'Andrew', 'Charles' or 'John'
as text in cells.
I want to put in cell K50 a function that returns the number of times that
'Charles' is mentioned in column D and where 'yes' is in the same row and
mentioned in column A.
I have tried 'sumproduct' but this only returns '0' and according to Excel
help only works with numerical data in the cells.

Please can anyone help.

Many thanks
--
Thank you,

Colin.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,339
Default Searching two columns against a specific criteria

SUMPRODUCT will work:

=SUMPRODUCT(--(D2:D30="Charles"),--(A2:A30="yes"))

It's better to put the parameters in cells and use:

=SUMPRODUCT(--(d2:d30=X1),--(A2:A30=x2))

x1="Charles", X2="Yes" (text)

the -- converts TRUE/FALSE to 1/0 so SUMPRODUCT can do the required
arithmetic.

P.S. In future, please post your formula(e) if you have problems.

HTH

"Colin" wrote:

Hi,
I have a range of data in A2:G30.
The cells in range A2:A30 have either 'yes' or 'no' as text in the cells.
The cells in range D2:D30 have either 'David', 'Andrew', 'Charles' or 'John'
as text in cells.
I want to put in cell K50 a function that returns the number of times that
'Charles' is mentioned in column D and where 'yes' is in the same row and
mentioned in column A.
I have tried 'sumproduct' but this only returns '0' and according to Excel
help only works with numerical data in the cells.

Please can anyone help.

Many thanks
--
Thank you,

Colin.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 86
Default Searching two columns against a specific criteria

Hi,

Big thank you for this. My main learning curve was understanding the
relevance of the dashes in the function. I'll take on board your comments
about the posting of the actual function next too.
--
Thank you,

Colin.


"Toppers" wrote:

SUMPRODUCT will work:

=SUMPRODUCT(--(D2:D30="Charles"),--(A2:A30="yes"))

It's better to put the parameters in cells and use:

=SUMPRODUCT(--(d2:d30=X1),--(A2:A30=x2))

x1="Charles", X2="Yes" (text)

the -- converts TRUE/FALSE to 1/0 so SUMPRODUCT can do the required
arithmetic.

P.S. In future, please post your formula(e) if you have problems.

HTH

"Colin" wrote:

Hi,
I have a range of data in A2:G30.
The cells in range A2:A30 have either 'yes' or 'no' as text in the cells.
The cells in range D2:D30 have either 'David', 'Andrew', 'Charles' or 'John'
as text in cells.
I want to put in cell K50 a function that returns the number of times that
'Charles' is mentioned in column D and where 'yes' is in the same row and
mentioned in column A.
I have tried 'sumproduct' but this only returns '0' and according to Excel
help only works with numerical data in the cells.

Please can anyone help.

Many thanks
--
Thank you,

Colin.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Count across multiple columns, using specific criteria MMcQ Excel Discussion (Misc queries) 9 August 27th 09 05:43 AM
Summing specific Columns based on Criteria [email protected] Excel Discussion (Misc queries) 4 June 1st 07 03:20 PM
Searching rows with multiple columns criteria wmclemore Excel Worksheet Functions 4 April 7th 06 05:12 PM
Sum rows if two columns = specific criteria. Jeff Excel Worksheet Functions 2 February 2nd 06 12:29 AM
searching for specific criteria and then doing an action based on Bill Excel Discussion (Misc queries) 1 July 20th 05 03:55 AM


All times are GMT +1. The time now is 01:55 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"