Not sure what the best function should be.

  • Thread starter Thread starter Jose'
  • Start date Start date
J

Jose'

I want a function that will put a cost amount in the Cost column based on
Plan type; for example if Plan=C then cost will be 6.17 if Plan=A then cost
will be 7.10.

I am not sure if this should be an IF(OR) statement or some other function
and how to write that function.

example

Item Plan Cost
xxx C 6.17
xxx A
xxx C
xxx A
xxx C

Thanks in advance
 
I assume that somewhere you have or can create a table of the Plans and their
associated costs. At that point I would be inclined to use a Vlookup or
Index/Match formula.
 
If you can only have A or C in the Plan column, then this would be
simple:

=IF(B2="C",6.17,7.1)

and you could extend this quite easily if you had a few more
acceptable values. If there is some relationship between the Plan
value and the Cost value, then you could calculate it.

However, if you had more variables in the Plan column, then you could
think about building up a 2-column table somewhere that had the Cost
associated with each variable, and then you could use VLOOKUP.

Hope this helps.

Pete
 
Hi,

One way. Change the values to suit

=LOOKUP(B2,{"A","B","C","D"},{1.5,2.5,3.7,4.9})

In practice you could use cell references for the values

=LOOKUP(B3,{"A","B","C","D"},$K$1:$K$4)

Mike

Mike
 
Thanks Jim:

Yes, I guess I could do it that way, because I only have two cost I am
dealing with 6.17 and 7.10 - I thought it would be more efficient to write a
formula.

Jose'
 
Back
Top