Sumif with 2 conditions

emmieh

New Member
Joined
Jun 25, 2009
Messages
11
Good afternoon,

I need to sum the values in row 22 with conditions in two other rows (5 and 6). I have this formula, but it does not work:
=SUM(IF(E$5:CZ$5="1";IF(E$6:CZ$6="LCPE*";E$22:CZ$22;0);0))

Row 5 is 0 or 1 and the condition is 1. Row 6 is a combination of the text LCPE and a number, so LCPE001, LCPE002 etc. The condition in row 6 is that the first four letters of the cell are LCPE. A LEFT function does not work for this. Does anybody know how to solve this?

thank you!
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Why do you have quotes around the 1 in the first condition? Are those values stored as a string or a number?

=SUMPRODUCT(--(E$5:CZ$5=1),--(LEFT(E$6:CZ$6,4)="LCPE"),E$22:C$Z22)
 
Upvote 0

Forum statistics

Threads
1,224,578
Messages
6,179,647
Members
452,934
Latest member
mm1t1

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top