Multiple Value Possibilities & Conditions

vickiccc

New Member
Joined
Jul 6, 2015
Messages
3
I have multiple products that have a certain price associated with them depending on what product group they belong to. Their product group is identified by a 2 letter prefix in the Product Title. I want to say, if the Product Title cell contains "AB", then Price = the AB Group Price. It would be easier to have a column that solely contains the product group associated with that row of data, but for multiple external reasons I cannot do that - the only way to identify the product group is from inside the Product Title.

I tried the following function, which let me alter between Group Prices of AB and DC -but it will not allow me to put any more optional value conditions/results (unless I'm doing something wrong):

=IF(COUNT(SEARCH("AB",'A2')),$E$2,IF(COUNT(SEARCH("DC",'A2'),1),$E$3))

Does anyone know what function would suit this? Thanks in advance.


ABCDE
1Product TitlePriceProduct GroupGroup Price
2AB - Product 1AB $3.45
3AB - Product 2DC$7.00
4AB - Product 3EF $7.00
5CD - Product 1
6CD - Product 2
7CD - Product 3
8EF - Product 1
9EF - Product 2
10EF - Product 3

<tbody>
</tbody>
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Hi
Welcome to he board

Try in B2:

=LOOKUP(2,1/SEARCH($D$2:$D$4,A2),$E$2:$E$4)

Copy down
 
Upvote 0

Excel 2010
ABCDE
1Product TitlePriceProduct GroupGroup Price
2AB - Product 1$3.45AB$3.45
3AB - Product 2$3.45CD$7.00
4AB - Product 3$3.45EF$9.00
5CD - Product 1$7.00
6CD - Product 2$7.00
7CD - Product 3$7.00
8EF - Product 1$9.00
9EF - Product 2$9.00
10EF - Product 3$9.00
Sheet1
Cell Formulas
RangeFormula
B2=VLOOKUP(LEFT(A2,2),$D$2:$E$10,2)
 
Upvote 0
Worksheet Formulas
CellFormula
B2=VLOOKUP(LEFT(A2,2),$D$2:$E$10,2)

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>

Hi shobolos

Just a remark: the formula requires that the product group has exactly 2 characters. If the product group in column D has a variable number of characters, like like "Orange", "Apple", you'll have to adapt the formula.
 
Upvote 0
Notice that my formula is also flawed. It will for ex. match Apple in Pineapple. Let's see what the OP says so that we can tune it (or not).
 
Upvote 0
Hi all,

This equation worked for some of them. I am getting an #N/A error for a handful of them.
The product group 2 character identifiers I've tried it on thus far:

HP - Product - #N/A
PR - Product - pulls fine
UL - Product - pulls fine
W7 - Product - pulls fine
HB - Product - #N/A
HS - Product - #N/A
O2 - Product - pulls fine
PO - Product - pulls fine

For whatever reason, all my product group identifiers with the letter H do not pull.
 
Last edited:
Upvote 0
Hi all,

Thanks for your help. Someone recommended I put the ,FALSE at the end and now they are working properly :).
 
Upvote 0
Hi
Welcome to he board

Try in B2:

=LOOKUP(2,1/SEARCH($D$2:$D$4,A2),$E$2:$E$4)

Copy down

@pgc01 I tried your formula and I modified it a bit removing 1/

=LOOKUP(2,SEARCH($D$2:$D$4,A2),$E$2:$E$4)

I belive in a big data set it could be a bit faster!
Bye!
 
Upvote 0

Forum statistics

Threads
1,214,895
Messages
6,122,128
Members
449,066
Latest member
Andyg666

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top