# help with an if, and if, or formula.

#### dpetersman

##### New Member
Hello again all,

I'm hoping one of you fine folks can lend me a hand again. I'm trying to figure the formula to use for the following scenario. i'll try to explain it so that it doesn't confuse ya too much (or myself for that matter)

A1 = RATE 1
A2 = RATE 2

B1 = HOURS WORKED
B2 = DIFFERENTIAL (this is essentially a makeshift "check box" where if "x" is entered, it means this person has a different rate for that day.

Now what I'm trying to get is...

C1 =
Code:
`` if B1="0" then "0.00" or if B1>"0" then B1*A1  or if B1>"0" AND B2="x" OR B2="X" then B1*A2``
in other words,

if zero hours are worked(B1), then output "0.00"
if more then zero hours are worked, then hours worked(B2) times Rate 1 (A1)
if more then zero hours are worked and there is an "x" or "X" in B2, then hours worked times rate 2 (A2)

Thanks for any help ya can offer

### Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.

#### mikerickson

##### MrExcel MVP
You are putting quotes around the 0 as if this is numbers stored as text. I'm guessing that that is wrong and that the numbers are stored as numbers.

=B1*IF(UPPER(B2)="X",A1,A2) should do what you want.

If my assumption was wrong and B1,A1 and A2 are text instead of numbers,

=(B1+0)*IF(UPPER(B2)="X",A1+0,A2+0) will be the formula.

#### dpetersman

##### New Member
Your assumption was indeed correct. I'm not exactly sure why I was putting the quotes around the 0

At any rate, only :28 minutes for the perfect answer! Worked like a charm!

Thank you so much

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

1,164,196
Messages
5,835,925
Members
430,396
Latest member
dzifna

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