IF Statement

S

Snake_Plisken

I have created an Excel Order form. After the Subtotal and Tax have been
calculated, I want the form to automatically put in the handling charges.
The IF Statement that I have used to format the cell is:
=IF((E39+E40)<10.01,3,IF(10.01<25,4,IF(25.01<40,5)))---where E39 = subtotal
and E40 = tax
Now this formula works great if order is less than 10.01--brings back 3 as
result. And if order is between 10.01 and 25 it brings back 4 as result.
However, it does not work if amount is above 25.01---still brings back 4 as
result when it should bring back 5. I would also like to continue IF
statement in this cell to bring back results up to $100.
Am I doing something wrong here? Why does formula work great up to a point,
but no further??
Could someone please help.

Thank you
 
D

daddylonglegs

You have to refer to E39+E40 in every clause, e.g.

=IF(E39+E40<10.01,3,IF(E39+E40<25,4,IF(E39+E40<40,5,6)))

or you could try LOOKUP...with a table or hard-coded into the formula like
this

=LOOKUP(E39+E40,{0,10.01,25,40;3,4,5,6})
 
S

Snake_Plisken

Thanks. This seems to work. However, I can't go pass an 8th condition. Can I
get more into the cell or is this the limit.
Ex.
=IF((E39+E40)<10.01,3,IF(E39+E40<25,5,IF(E39+E40<40,6,IF(E39+E40<55,7,IF(E39+E40<70,8,IF(E39+E40<85,9,IF(E39+E40<100,10,IF(E39+E40<150,12,IF(E39+E40<200,14,IF(E39+E40<300,15,))))))))))

Receive error at 9th
condition...IF(E39+E40<200,14,IF(E39+E40<300,15,))))))))))

Last , but not least, I would like every order that is over $300 to have
handling charges equal to 7% of the order (subtot+tax). So would the final
condition read.....IF(E39+E40>300,*7%

Would a LOOKUP statement help here?

Again thanks for your help
 
S

Snake_Plisken

Thanks. This seems to work. However, I can't go pass an 8th condition. Can I
get more into the cell or is this the limit.
Ex.
=IF((E39+E40)<10.01,3,IF(E39+E40<25,5,IF(E39+E40<40,6,IF(E39+E40<55,7,IF(E39+E40<70,8,IF(E39+E40<85,9,IF(E39+E40<100,10,IF(E39+E40<150,12,IF(E39+E40<200,14,IF(E39+E40<300,15,))))))))))

Receive error at 9th
condition...IF(E39+E40<200,14,IF(E39+E40<300,15,))))))))))

Last , but not least, I would like every order that is over $300 to have
handling charges equal to 7% of the order (subtot+tax). So would the final
condition read.....IF(E39+E40>300,*7%

Would a LOOKUP statement help here?

Again thanks for your help
 
S

Snake_Plisken

LOOKUP works perfectly. Again though I need to resolve the issue of orders
over $300. I need the result to be 7% of total. I tried to use multiplication
at the end of string (......,*7%) and also (........,*1.7) neither worked.
Any suggestions?

Thanks
 
R

RagDyeR

Just *insert* the actual formula you want to use:

Instead of:
IF(E39+E40>300,*7%
USE:
IF(E39+E40>300,(E39+E40)*7%

--

HTH,

RD
=====================================================
Please keep all correspondence within the Group, so all may benefit!
=====================================================

LOOKUP works perfectly. Again though I need to resolve the issue of orders
over $300. I need the result to be 7% of total. I tried to use
multiplication
at the end of string (......,*7%) and also (........,*1.7) neither worked.
Any suggestions?

Thanks
 
S

Snake_Plisken

Tried this RagDyeR. There is a syntax error.
Here is my formula:

=LOOKUP(E39+E40,{0,10.01,25.01,40.01,55.01,70.01,85.01,100.01,150.01,200.01,300.01;3,5,6,7,8,9,10,11,13,14,IF(E39+E40>300,(E39+E40)*7%}))

Can I place an IF statement within a LOOKUP? After the error, Excel
highlights the *7%.
 
R

RagDyeR

You've a couple of things wrong.

Your array is uneven (lookup vector = 11, result vector = 10).
I added 0 at the beginning of the result vector.

The array constant curly brackets should enclose *only* the array.
You have it including the rest of the formula, out to the 7%.

You didn't really need the "IF()", so I replaced it with a boolean argument.

See if this works for you:

=LOOKUP(E39+E40,{0,10.01,25.01,40.01,55.01,70.01,85.01,100.01,150.01,200.01,300.01;0,3,5,6,7,8,9,10,11,13,14})+(E39+E40>300)*((E39+E40)*7%)

--

HTH,

RD
=====================================================
Please keep all correspondence within the Group, so all may benefit!
=====================================================

Tried this RagDyeR. There is a syntax error.
Here is my formula:

=LOOKUP(E39+E40,{0,10.01,25.01,40.01,55.01,70.01,85.01,100.01,150.01,200.01,300.01;3,5,6,7,8,9,10,11,13,14,IF(E39+E40>300,(E39+E40)*7%}))

Can I place an IF statement within a LOOKUP? After the error, Excel
highlights the *7%.
 
S

Snake_Plisken

Thanks RagDyeR, this works.

RagDyeR said:
You've a couple of things wrong.

Your array is uneven (lookup vector = 11, result vector = 10).
I added 0 at the beginning of the result vector.

The array constant curly brackets should enclose *only* the array.
You have it including the rest of the formula, out to the 7%.

You didn't really need the "IF()", so I replaced it with a boolean argument.

See if this works for you:

=LOOKUP(E39+E40,{0,10.01,25.01,40.01,55.01,70.01,85.01,100.01,150.01,200.01,300.01;0,3,5,6,7,8,9,10,11,13,14})+(E39+E40>300)*((E39+E40)*7%)

--

HTH,

RD
=====================================================
Please keep all correspondence within the Group, so all may benefit!
=====================================================

Tried this RagDyeR. There is a syntax error.
Here is my formula:

=LOOKUP(E39+E40,{0,10.01,25.01,40.01,55.01,70.01,85.01,100.01,150.01,200.01,300.01;3,5,6,7,8,9,10,11,13,14,IF(E39+E40>300,(E39+E40)*7%}))

Can I place an IF statement within a LOOKUP? After the error, Excel
highlights the *7%.

: > Just *insert* the actual formula you want to use:
 

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