help with an if, and if, or formula.

dpetersman

New Member
Joined
Mar 26, 2009
Messages
5
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 :)
 

Some videos you may like

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.

mikerickson

MrExcel MVP
Joined
Jan 15, 2007
Messages
23,904
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
Joined
Mar 26, 2009
Messages
5
Your assumption was indeed correct. I'm not exactly sure why I was putting the quotes around the 0 :confused:

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

Thank you so much :)
 

Watch MrExcel Video

Forum statistics

Threads
1,122,481
Messages
5,596,399
Members
414,063
Latest member
N_Bates

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
Top