ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Not sure what the best function should be. (https://www.excelbanter.com/excel-discussion-misc-queries/243489-not-sure-what-best-function-should.html)

Jose'

Not sure what the best function should be.
 
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

Jim Thomlinson

Not sure what the best function should be.
 
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.
--
HTH...

Jim Thomlinson


"Jose'" wrote:

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


Pete_UK

Not sure what the best function should be.
 
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

On Sep 23, 4:24*pm, Jose' wrote:
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



Mike H

Not sure what the best function should be.
 
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

"Jose'" wrote:

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


Jose''

Not sure what the best function should be.
 
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'

"Jim Thomlinson" wrote:

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.
--
HTH...

Jim Thomlinson


"Jose'" wrote:

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


Jose''

Not sure what the best function should be.
 
Pete... EXCELLENT... This is what I was looking for... THANK YOU !!!

Jose
--
So many spreadsheets and so little time. ----- Jose''


"Pete_UK" wrote:

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

On Sep 23, 4:24 pm, Jose' wrote:
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




Pete_UK

Not sure what the best function should be.
 
You're welcome, Jose - thanks for feeding back.

Pete

On Sep 23, 4:46*pm, Jose'' wrote:
Pete... * EXCELLENT... This is what I was looking for... * THANK YOU !!!

Jose
--
So many spreadsheets and so little time. * * ----- Jose''



"Pete_UK" wrote:
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


On Sep 23, 4:24 pm, Jose' wrote:
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- Hide quoted text -


- Show quoted text -




All times are GMT +1. The time now is 11:48 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com