View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.misc
Bernard Liengme[_3_] Bernard Liengme[_3_] is offline
external usenet poster
 
Posts: 1,104
Default using if for multiple criteria

How about
=SUMPRODUCT((F2:K2="W")*C2)+SUMPRODUCT((F2:K2="I") *D2)+SUMPRODUCT((F2:K2="B")*E2)
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"enna49" wrote in message
...
Hi
The Breakdown cost is to be included in the Total
eg
C2 = Working Shift Cost
D2 = Idle Shift Cost
E2 = Breakdown
F2 to K2 represents days of the week (Mon - Sat) and a Total is required
for
this cost. Using Excel 2007

Thanking you
Anne
"Bernard Liengme" wrote:

Please expand. If E2:J2 = "B" what is to happen to the sum/
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"enna49" wrote in message
...
Thank you Bernard

I tried SUMPRODUCT prior, now I see where I went wrong from your code.

I have added another request to this original: There is now another
Criteria required. eg BREAKDOWN "B". I know I should be able to add
this,
but it is not working.
Any Help would be appreciated.
Thanks

"Bernard Liengme" wrote:

This is a bit neater
=SUMPRODUCT((E2:J2="W")*C2)+SUMPRODUCT((E2:J2<"W" )*D2)
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"enna49" wrote in message
...
Hi
I have used the formula below for adding across cells if certain
criteria.
This does work, however is there a cleaner way of doing this.
Example
Data
below:

C2 = Working Shift Cost
D2 = Idle Shift Cost
E2 to J2 represents days of the week (Mon - Sat) and a Total is
required
for
this cost. Using Excel 2007

=SUM(IF(E2="W",C2,D2)+(IF(F2="w",C2,D2))+(IF(G2="w ",C2,D2))+(IF(H2="w",C2,D2))+(IF(I2="w",C2,D2))+(I F(J2="w",C2,D2)))
Thanking you
Anne