# If, AND, OR - How to

#### fernipascual

##### Board Regular
Hi:

I have two columns with data going down hundreds of rows, including blank cells. Columns E & F.

If in the row, both E and F > 0, \$10. If one of them is 0 (or blank) and the other >0, then \$5, If both are 0 (or blank), then \$0.

I hope this is enough information.

Thanks

### Excel Facts

Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

#### Jonmo1

##### MrExcel MVP
Try

=COUNTIF(E2:F2,">0")*5

#### fernipascual

##### Board Regular
I ommitted the most important part because I thought I could figure it out. So here’s the rest.

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 once for each product. Either \$5 per product or \$3. 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

Thanks!
 E F G H I Month 1 Month 1 Month 2 Month 2 Payment Formula Prod A Prod B Prod A Prod B 4 2 5 8 \$10 5 0 5 2 \$8 0 5 2 2 \$8 0 0 3 5 \$6 0 0 3 0 \$3 0 0 0 2 \$3 0 0 0 0 \$0 0

<tbody>
</tbody>

#### fernipascual

##### Board Regular
Hello folks:

I am reviving this thread since it seems to have fallen through the cracks.

Thanks

Replies
3
Views
344
Replies
1
Views
281
Replies
1
Views
189
Replies
3
Views
726
Replies
3
Views
264

1,195,598
Messages
6,010,644
Members
441,558
Latest member
lambierules

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

### Which adblocker are you using?

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

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