# If, AND, OR Help

#### fernipascual

##### Board Regular
Hello all:

This is a program that pays based on product sold. There are two products, A & B and two eligible periods, Month 1 and Month 2. They only get paid one time for each product. Either \$5 per product (if sold in Month 1) or \$3 (if sold in Month 2). Here are the scenarios:

Month 1 - Sold product A & B = \$10. Month 2 – sold product but no payment
Month 1 – Sold product A = \$5, no B. Month 2 - Sold product B = \$3, (doesn’t matter if sold A)
Month 1 – Sold product B = \$5, no A. Month 2 - Sold product A = \$3, (doesn’t matter if sold B)
Month 1 – no product sold. Month 2 sold A & B = \$6
Month 1 – no product sold. Month 2 sold A = \$3, no B = \$0
Month 1 – no product sold. Month 2 sold B = \$3, no A = \$0
Month 1 and Month 2 - Did not sell product at all

 row e f g h i 1 Month 1 Month 1 Month 2 Month 2 Payment Formula 2 Product A Product B Product A Product B 3 4 2 5 8 \$10 4 5 0 5 2 \$8 5 0 5 2 2 \$8 6 0 0 3 5 \$6 7 0 0 3 0 \$3 8 0 0 0 2 \$3 9 0 0 0 0 \$0

<tbody>
</tbody>

Thanks!

### Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Put this in I3 and copy down.

=IF(E3>0,5,IF(G3>0,3,0))+IF(F3>0,5,IF(H3>0,3,0))

Put this in I3 and copy down.

=IF(E3>0,5,IF(G3>0,3,0))+IF(F3>0,5,IF(H3>0,3,0))

Thank you so much. It worked.

Let me see if I understand the logic. The true condition for month one Product A returns a 5. The false condition looks at month 2 and if it's true then returns a \$3. If both are false, then returns a \$0. It's so easy... once somebody else does it! Ha, Ha

What would need to be done of there were 10 products for month 1 and month 2? Or 100 products?

Replies
5
Views
321
Replies
0
Views
508
Replies
1
Views
597
Replies
2
Views
404
Replies
9
Views
2K

1,196,329
Messages
6,014,681
Members
441,835
Latest member
rthomas268

### 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?

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