nesting if formula

J

john

=if(f6<56.16, f6*7.2,f6*7.9/2)

hi all
the above formula calculates f6, when less it does the far calculation
otherwise it performs the other,what i really want is for f6 to have 4 points
of reference from f6< 40 multply x3 ,from30x5 ,from 20 multiply 6 ,from 10
multiply x7
any help please
thanks john
 
L

Lars-Åke Aspelin

=if(f6<56.16, f6*7.2,f6*7.9/2)

hi all
the above formula calculates f6, when less it does the far calculation
otherwise it performs the other,what i really want is for f6 to have 4 points
of reference from f6< 40 multply x3 ,from30x5 ,from 20 multiply 6 ,from 10
multiply x7
any help please
thanks john

Is this want you want?

If the value in cell F6 is 40 or more you would like the formula to
return the value in cell F6 multiplied by 3
If the value in cell F6 is 30 or more (but less than 40) you would
like the formula to return the value in cell F6 multiplied by 5
If the value in cell F6 is 20 or more (but less than 30) you would
like the formula to return the value in cell F6 multiplied by 6
If the value in cell F6 is 10 or more (but less than 20) you would
like the formula to return the value in cell F6 multiplied by 7.

You have not defined what result you want if the value in cell F6 is
less than 10, so we assume that this will never happen.

Try this formula:

=F6*CHOOSE(MATCH(F6,{10,20,30,40}),7,6,5,3)

Hope this helps / Lars-Åke
 
G

Gary''s Student

=F6*IF(F6<10,7,IF(F6<20,6,IF(F6<30,5,IF(F6<40,3,1))))

this assumes that if f6=>40
then the factor is 1
 
L

Lars-Åke Aspelin

Then try this:

=F6*CHOOSE(MATCH(F6,{-1E+300,10,20,30,40}),15,7,6,5,3)

The -1E+300 could be be replaced with any value that is less than the
smallest possible value in F6.

/ Lars-Åke
 
J

john

thanks could you explain what the 1e+300 does, works very well just curious
would be gratefull if you walk throuhg the formula as yours works
thanks
john
 
S

Shane Devenshire

Hi,

Although you can do this type of problem with a nested if, if there were too
many IF's Excel would not be happy, so its probably good practice to consider
another solution, and one that give a lot of flexibility in the long run is
VLOOKUP. In this case create a lookup table in a range, say C1:D5 as follows

-10000 7
10 6
20 5
30 3
40 1

The -10000, just replace that with the smallest number you would ever get in
your data.

The the formula would be

=F5*VLOOKUP(F5,C$1:D$5,2,1)

If this helps, please click the Yes button.

Cheers,
Shane Devenshire
 
J

john

thanks
the formula is good, can it be adjusted to include a range of numbers say
1-10 and return a static sum ,kind of like a minimum charge for the first few
items.thanks
john
 

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