Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 75
Default Sumproduct assistance - need multiple ANDs and ORs

We are trying to count the number of rows whe
(1) the date is one of two dates (date1 OR date2) AND
(2) a column is one of two values (value1 OR value2)

I am familiar with using sumproduct to do either AND (*) or OR (+), but am
not sure how to approach mixing the two. Does anyone have any suggestions?

Thanks,

Heidi
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,726
Default Sumproduct assistance - need multiple ANDs and ORs

=SUMPRODUCT(--((C1:C20=date1)+(C1:C20=date2)),--((D1:D20="value1")+(D1:D20="value2")))

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Heidi" wrote in message
...
We are trying to count the number of rows whe
(1) the date is one of two dates (date1 OR date2) AND
(2) a column is one of two values (value1 OR value2)

I am familiar with using sumproduct to do either AND (*) or OR (+), but am
not sure how to approach mixing the two. Does anyone have any
suggestions?

Thanks,

Heidi



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,572
Default Sumproduct assistance - need multiple ANDs and ORs

Try this:

=SUMPRODUCT(((A1:A30=C1)+(A1:A30=C2))*((B1:B30=D1) +(B1:B30=D2)))

Just group the arguments correctly with parens.
--

HTH,

RD
================================================== ===
Please keep all correspondence within the Group, so all may benefit!
================================================== ===

"Heidi" wrote in message
...
We are trying to count the number of rows whe
(1) the date is one of two dates (date1 OR date2) AND
(2) a column is one of two values (value1 OR value2)

I am familiar with using sumproduct to do either AND (*) or OR (+), but am
not sure how to approach mixing the two. Does anyone have any suggestions?

Thanks,

Heidi


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 75
Default Sumproduct assistance - need multiple ANDs and ORs

Thank you Bob and RD. Your suggestions worked!

-Heidi



"Heidi" wrote:

We are trying to count the number of rows whe
(1) the date is one of two dates (date1 OR date2) AND
(2) a column is one of two values (value1 OR value2)

I am familiar with using sumproduct to do either AND (*) or OR (+), but am
not sure how to approach mixing the two. Does anyone have any suggestions?

Thanks,

Heidi

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



All times are GMT +1. The time now is 02:05 AM.

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

About Us

"It's about Microsoft Excel"