ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   if formula with variables (https://www.excelbanter.com/excel-worksheet-functions/221367-if-formula-variables.html)

Ronda

if formula with variables
 
I have a spreadsheet that I need to take the base cost of an item and add an
option if it applies to that item.
Example
Apples = 2.00
Apples with caramel = 2.50
Apples with maple = 2.50
Apples with Peanut butter = 3.00
Apples with Jelly = $3.00
I have my if number in column D, I have my variable (caramel, maple, etc
listed in column I with the correspondening number in column H. my pricing
for the option is in column J. This is kind of what I need

=if(d2=h3:h7),j3


~L

if formula with variables
 
I read this as:
You have a list of option numbers with names. 1 = Caramel, 2 = maple, etc.
These options have corresponding prices.

This information is arranged whe Column H is option number, column I is
option name, column J is option price.

And you want to look up an option number from column D, then return an
option price.

If that is the case, you can use VLOOKUP to return the price.

Assuming the lookup data begins in row 3 and the option/name/price list ends
at row 7:

In E2 enter:

=VLOOKUP(D2,$H$3:$J$7,3)


"Ronda" wrote:

I have a spreadsheet that I need to take the base cost of an item and add an
option if it applies to that item.
Example
Apples = 2.00
Apples with caramel = 2.50
Apples with maple = 2.50
Apples with Peanut butter = 3.00
Apples with Jelly = $3.00
I have my if number in column D, I have my variable (caramel, maple, etc
listed in column I with the correspondening number in column H. my pricing
for the option is in column J. This is kind of what I need

=if(d2=h3:h7),j3


~L

if formula with variables
 
Sorry, this requires something extra:

=VLOOKUP(D2,$H$3:$J$7,3,FALSE)

"~L" wrote:

I read this as:
You have a list of option numbers with names. 1 = Caramel, 2 = maple, etc.
These options have corresponding prices.

This information is arranged whe Column H is option number, column I is
option name, column J is option price.

And you want to look up an option number from column D, then return an
option price.

If that is the case, you can use VLOOKUP to return the price.

Assuming the lookup data begins in row 3 and the option/name/price list ends
at row 7:

In E2 enter:

=VLOOKUP(D2,$H$3:$J$7,3)


"Ronda" wrote:

I have a spreadsheet that I need to take the base cost of an item and add an
option if it applies to that item.
Example
Apples = 2.00
Apples with caramel = 2.50
Apples with maple = 2.50
Apples with Peanut butter = 3.00
Apples with Jelly = $3.00
I have my if number in column D, I have my variable (caramel, maple, etc
listed in column I with the correspondening number in column H. my pricing
for the option is in column J. This is kind of what I need

=if(d2=h3:h7),j3


Ronda

if formula with variables
 
Thanks for your help. I did get the Vlookup to work without the false. Can
you tell me what that is for?


"~L" wrote:

Sorry, this requires something extra:

=VLOOKUP(D2,$H$3:$J$7,3,FALSE)

"~L" wrote:

I read this as:
You have a list of option numbers with names. 1 = Caramel, 2 = maple, etc.
These options have corresponding prices.

This information is arranged whe Column H is option number, column I is
option name, column J is option price.

And you want to look up an option number from column D, then return an
option price.

If that is the case, you can use VLOOKUP to return the price.

Assuming the lookup data begins in row 3 and the option/name/price list ends
at row 7:

In E2 enter:

=VLOOKUP(D2,$H$3:$J$7,3)


"Ronda" wrote:

I have a spreadsheet that I need to take the base cost of an item and add an
option if it applies to that item.
Example
Apples = 2.00
Apples with caramel = 2.50
Apples with maple = 2.50
Apples with Peanut butter = 3.00
Apples with Jelly = $3.00
I have my if number in column D, I have my variable (caramel, maple, etc
listed in column I with the correspondening number in column H. my pricing
for the option is in column J. This is kind of what I need

=if(d2=h3:h7),j3


~L

if formula with variables
 
The last argument of VLOOKUP is TRUE or FALSE. FALSE means exact match, TRUE
means closest match. If omitted, TRUE is the default value.

Glad I could help!

"Ronda" wrote:

Thanks for your help. I did get the Vlookup to work without the false. Can
you tell me what that is for?


"~L" wrote:

Sorry, this requires something extra:

=VLOOKUP(D2,$H$3:$J$7,3,FALSE)

"~L" wrote:

I read this as:
You have a list of option numbers with names. 1 = Caramel, 2 = maple, etc.
These options have corresponding prices.

This information is arranged whe Column H is option number, column I is
option name, column J is option price.

And you want to look up an option number from column D, then return an
option price.

If that is the case, you can use VLOOKUP to return the price.

Assuming the lookup data begins in row 3 and the option/name/price list ends
at row 7:

In E2 enter:

=VLOOKUP(D2,$H$3:$J$7,3)


"Ronda" wrote:

I have a spreadsheet that I need to take the base cost of an item and add an
option if it applies to that item.
Example
Apples = 2.00
Apples with caramel = 2.50
Apples with maple = 2.50
Apples with Peanut butter = 3.00
Apples with Jelly = $3.00
I have my if number in column D, I have my variable (caramel, maple, etc
listed in column I with the correspondening number in column H. my pricing
for the option is in column J. This is kind of what I need

=if(d2=h3:h7),j3



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

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