Help with nested if function

MannyLNJ

New Member
Joined
Oct 2, 2011
Messages
11
I need to write an if function that will do the following

IFC1 is greater than G1* . 90 set H1 to G1 * .90
IFC1 is greater than G1* . 84 set H1 to G1 * .84
IFC1 is greater than G1* .49 set H1 to G1 * .49
IFC1 is greater than G1* . 25 set H1 to G1 * .25
otherwise set G1 to ""

How to do I turn this into an IF statement
 
Thank you. Now that error is gone. The results don't make sense but the error is gone.

C22=1285.61
E22=71.63
G22=-999

so I expect H22 to be 1213.98 but it's showing -899.10

Any ideas?
 
Upvote 0

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
This is because the first If it encounters is True:
=IF(C22>G22*0.9,G22*0.9,
IF(C22>G22*0.84,G22*0.84,
IF(C22>G22*0.49,G22*0.49,
IF(C22>G22*0.25,G22*0.25,
if(G22=-999,C22-E22,""
)))))

if(1285.61>-999*0.9,-999*0.9,
becomes:
if(1285.61>-899.1,-899.1,

so I'm only guessing that you might want to check for -999 first?:

=IF(G22=-999,C22-E22,
IF(C22>G22*0.9,G22*0.9,
IF(C22>G22*0.84,G22*0.84,
IF(C22>G22*0.49,G22*0.49,
IF(C22>G22*0.25,G22*0.25,""
)))))

which with extra carriage returns removed becomes:

Code:
=IF(G22=-999,C22-E22,IF(C22>G22*0.9,G22*0.9,IF(C22>G22*0.84,G22*0.84,IF(C22>G22*0.49,G22*0.49,IF(C22>G22*0.25,G22*0.25,"")))))
I don't know...
 
Upvote 0

Forum statistics

Threads
1,224,587
Messages
6,179,740
Members
452,940
Latest member
rootytrip

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