S
Stefan Robert
Hello,
I need to create an Excel sheet to calculate price regarding relative
to the cost of some items. The cost vs price is a table that gives the
following information:
If carrots cost 4$ (A1=4) or less, the price should be 4.25$ (A2 = 4.25)
if carrots costs between 4 and 5$, (A3 = 5) the price should be 5.35$
(A4 = 5.35)
if carrots costs between 5 and 6$, (A5 = 6) the price should be 6.15$
(A6 = 6.15)
and this goes on for at least 20 other conditions.
On another page I have a cell were I enter the cost (B1) and the cell
right next to it (B2) will contain the formula that gives me the answer
according the ranges.
I used embedded IF statements for this and it looks like this:
IF(B1<4; 4.25; IF(B1<5;5.35;IF(B1<6;6.10; IF(...))))
I have written the value of cells A1 to A6 just to make the example
simpler to understand.
Now, the number of conditions might change from week to week and
because of this, I need to edit my IF() statement to satisfy this
everytime, which is very time consuming. Also, this is only for the
carrots, I have about 40 other items that have to be calculated that
way using different range and a different number of conditions for each
item.
Is there a better way to do this than using embedded IF statements? Or
is there a way to dynamically change the number of IF?
Thanks for the help
Stefan
I need to create an Excel sheet to calculate price regarding relative
to the cost of some items. The cost vs price is a table that gives the
following information:
If carrots cost 4$ (A1=4) or less, the price should be 4.25$ (A2 = 4.25)
if carrots costs between 4 and 5$, (A3 = 5) the price should be 5.35$
(A4 = 5.35)
if carrots costs between 5 and 6$, (A5 = 6) the price should be 6.15$
(A6 = 6.15)
and this goes on for at least 20 other conditions.
On another page I have a cell were I enter the cost (B1) and the cell
right next to it (B2) will contain the formula that gives me the answer
according the ranges.
I used embedded IF statements for this and it looks like this:
IF(B1<4; 4.25; IF(B1<5;5.35;IF(B1<6;6.10; IF(...))))
I have written the value of cells A1 to A6 just to make the example
simpler to understand.
Now, the number of conditions might change from week to week and
because of this, I need to edit my IF() statement to satisfy this
everytime, which is very time consuming. Also, this is only for the
carrots, I have about 40 other items that have to be calculated that
way using different range and a different number of conditions for each
item.
Is there a better way to do this than using embedded IF statements? Or
is there a way to dynamically change the number of IF?
Thanks for the help
Stefan