Multiply IF with multiple conditions

noonia

New Member
Joined
Jun 2, 2018
Messages
2
Good Evening,

today I came across the following problem:

Say we have a table where the a-column is for example the color of a car, the b-column who sold the car and the c-column is the price it sold for.We now want to multiply the values of all red cars sold by Peter and here lies the problem.
When doing this with only 1 condition, say color, I would use =PRODUCT(IF(A1:A10="red",C1:C10,"")) and it would work perfectly fine, however as soon as 2 or more conditions come into play my approach was =PRODUCT(IF(AND(A1:A10="red";B1:B10="Peter");C1:C10;"")) but for some reason this does not work.

If both conditions are met it still works, if at least one is not it will return a #VALUE error and I don't understand why because the result of the test should be in the same format, shouldn't it?

best regards
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Welcome to the MrExcel board!

Instead of the AND() structure, try stringing the conditions in IF() functions like this (still array-entered)

{=PRODUCT(IF(A1:A10="red",IF(B1:B10="Peter",C1:C10)))}
 
Upvote 0
Welcome to Mr Excel forum

To use AND condition in array formulas you should multiply the conditions
Try
=PRODUCT(IF((A1:A10="red")*(B1:B10="Peter"),C1:C10,""))
Ctrl+Shift+Enter

EDIT: or use nested IFs as suggested by Peter

M.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,587
Messages
6,120,406
Members
448,958
Latest member
Hat4Life

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