More than one "if" in a cell

B

Buggelsgaard

I would like to put all these functions into one cell:
IF H7 is less than 1, then the result is 0.
IF H7 is 1-39, then the result is C7+(E7*H7).
IF H7 is more than 39, then the result is D7+(F7*H7).

How would this formula be created?
 
B

Bernard Liengme

=IF(H7<1,0, IF(H7>39,D7+(F7*H7), C7+(E7*H7)))
or
=(H7>39)*(D7+(F7*H7))+(H7<39)*(H7>=1)*(C7+(E7*H7))
best wishes
 
B

Buggelsgaard

No.1 doesn't give the correct result it gives a "false" result.

No.2. works fine - thanks a lot.

/Buggelsgaard

"Bernard Liengme" skrev:
 
B

Buggelsgaard

Doesn't work correct - gives a "false" statement. Though I have found the
right solution by one of the other suggestions on this thread.

Thanks

/Buggelsgaard

"Niek Otten" skrev:
 
D

Dave Peterson

You may want to try those formulas again--even though you have a working
solution.
 
D

David Biddulph

No. 1 can not give a "false" result (or if it can, it would be interesting
to know what data values you have that give it). I assume that you have
tried to retype and mistyped. If you get a suggested formula in this group,
copy from here and paste into your formula bar; don't try to retype.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top