View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.misc
MartinW MartinW is offline
external usenet poster
 
Posts: 860
Default Complicated formula

Hi Lemony,

Sandy's approach is more efficient and the better way to go.
Just for interest sake here is an expansion of my approach.
This is assuming your cutoff values are 3,10 +15
and your multiply values are in B1,C1,D1 and E1.

=IF(A1<=3,A1*B1,IF(AND(A13,A1<=10),A1*C1,IF(AND(A 110,A1<=15),A1*D1,A1*E1)))
As you can see it quickly becomes rather lengthy and hard to follow.

Instead of nesting IF statements it is often better to use the LOOKUP or
VLOOKUP
functions.

One example using the above cutoff limits and multiplication
values of say 1.5, 2.5, 3.5 and 4.5
Then use this in any cell
=A1*LOOKUP(A1,{0,4,11,16},{"1.5","2.5","3.5","4.5" })

HTH
Martin


"Lemony_m" wrote in message
...
How can I add another condition (4 not 3)?

"MartinW" wrote:

Hi Lemony,

With your number in A1, your first multiply value in B1, your second
multiply value in C1 and your third multiply value in D1.
Put this in E1.
=IF(A1<=3,A1*B1,IF(AND(A13,A1<=10),A1*C1,A1*D1))

You didn't specify your exact cutoff points so you may need
to adjust the less than or equals bits.

HTH
Martin



"Lemony_M" wrote in message
...
I need to multiply a number by a value in a cell but if the number is
greater
than 3 it needs to be muliplied by a value in a different cell if that
makes
any sense at all!!
I also need to be able to do the above but with 3 different values (e.g
less
than three, 4 to 9 and greater than 10) Please help as I am getting
very
annoyed with myself!!