Lookupvalue on multivalued fields separated by commas

samuelbruxel

New Member
Joined
Aug 16, 2013
Messages
1
I'm trying for a few days to get this done right, so I thought I should ask for help in this forum.

So, I have 2 tables like this:

Table1 with 2 columns: OrderID(alphanumerical formatted as text) and Price($)
Table2 that has a column ServiceID (number), and Orders (same as OrderID, but formatted with Orders separated by commas, 1 to 10 orders usually)

Table1
OrderID Price
DW4500 $7540,00
DW4501 $2497,00
DW4502 $7961,00
DW4503 $672,00

Table2
ServiceID Orders
22701715 DW4500
22701716 DW4501,DW4502,DW4503

What I want is to SUM total value for that ServiceID.

At first I tried Lookupvalue for an extra column on Table1 to get the ServiceID and SUM after on a pivottable.
I can easily do that when the ServiceID has only ONE order.

I need to find a way to get that ServiceID into the corresponding row on Table2.

Anyone? Thanks in advance
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Here! Try This -

Put the Below Table in Range A1:B5

OrderID Price

DW4500 $7540,00
DW4501 $2497,00
DW4502 $7961,00
DW4503 $672,00

Put the below Table in D1:E3

ServiceIDOrders
22701715DW4500
22701716DW4501,DW4502,DW4503

<tbody>
</tbody>

And Put this Formula in Cell F2 and Commit using Ctrl + Shift + Enter. Drag It down as required.

=SUM(LOOKUP(MID(E2,CHOOSE(LEN(E2)-LEN(SUBSTITUTE(E2,",",""))+1,1,{1,8},{1,8,15},{1,8,15,22},{1,8,15,22,29}),6),$A$2:$A$5,$B$2:$B$5))

Hope it helps!

Deep :)
 
Last edited:
Upvote 0
BTW, Make sure those $ Signs aint Text. Put the Number in (Like 7540) and then Format it to currency if you like.
 
Upvote 0

Forum statistics

Threads
1,215,563
Messages
6,125,568
Members
449,237
Latest member
Chase S

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