Need formula to find match, then divide bulk pricing to produce total price per piece.

solidENM

Board Regular
Joined
Feb 23, 2017
Messages
87
Hello,
I have a master list that includes crates and individual piece pricing. When this was originally setup, it was all manual. There are thousands of items and pricing changes do occur. I have received updated pricing for crates, but not individual pieces. I need help creating a formula that will take a crate #, get the quantity from the matching cell, and divide the total price by packs and boxes.

Using the table below, yellow crates in row 1 show there are 20 boxes with 5600 pieces each, total price for all that is 4312.25.
Row 4 has an individual yellow part. Column E shows the matching crate number. I need a formula that will use E4, search column a for a match, then take 4312.25 / 20 / 5600, and then fill in the new price in D4. In this case, its 0.038502

Essentially it will take total price, divide by boxes, by pieces, and produce the each price in column D. each crates description is in the same format, with a #x # at the end of each cell. This is the modifier I need to divide the price in column D.


rowColumn aColumn CColumn DColumn E
Part NumberDescriptionPriceBulk # (if appl)
15698552362yellow 20X56004312.25
25698552373Green 20X60001945.25
35698552384red 20X60702525.12
46574552345yellow piece 0.0385025698552362
56574552356green piece5698552373
66574552367red piece5698552384

<tbody>
</tbody>


If i can get this formula working, I will only have to type in the bulk part# equivalent for each "piece line" and future updates will go smoothly.


Thanks for looking, and Im hoping you can help.
 
Last edited:

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
How's this?

=IFERROR(VLOOKUP(E2,A:D,4,0)/(MID(VLOOKUP(E2,A:C,3,0),FIND("X",VLOOKUP(E2,A:C,3,0))+1,4)*MID(VLOOKUP(E2,A:C,3,0),FIND(" ",VLOOKUP(E2,A:C,3,0))+1,FIND("X",VLOOKUP(E2,A:C,3,0))-FIND(" ",VLOOKUP(E2,A:C,3,0))-1)),"")
 
Last edited:
Upvote 0
Hi Mrshl, thanks for the reply but im not seeing anything popup after this is inserted. I tried altering it a bit to see if the columns had anything to do with it. Column a is the condensed part#, and column b is spaced apart for better readability (setup as =replace from column a). Im not sure if thats throwing a wrench in your code.
 
Upvote 0
Vlookup(e5;$b$2:$d$4;3;false)/right(vlookup(e5;$b$2:$c$4;2;false);(len(vlookup(e5;$b$2:$c$4;2;false))-search("x";vlookup(e5;$b$2:$c$4;2;false);1)))/mid(vlookup(e5;$b$2:$c$4;2;false);find(" ";vlookup(e5;$b$2:$c$4;2;false);1)+1;(search("x";vlookup(e5;$b$2:$c$4;2;false);1)-find(" ";vlookup(e5;$b$2:$c$4;2;false);1)-1))
 
Upvote 0
As long as the part number 5698552362 is in A, yellow 20X5600 is in C and 4312.25 is in D that should get you the result.

What is an example of what is in B?
 
Last edited:
Upvote 0
=REPLACE(REPLACE(REPLACE(A3504,8,0," "),5,0," "),2,0," ")

this is an example from B column
takes A and adds spaces.
5698552384 turns into 5 698 552 384
 
Upvote 0
Sorry mate, a bad copy and paste on my behalf (I had this in Column F originally).

In D5

=IFERROR(VLOOKUP(E5,A:D,4,0)/(MID(VLOOKUP(E5,A:C,3,0),FIND("X",VLOOKUP(E5,A:C,3,0))+1,4)*MID(VLOOKUP(E5,A:C,3,0),FIND(" ",VLOOKUP(E5,A:C,3,0))+1,FIND("X",VLOOKUP(E5,A:C,3,0))-FIND(" ",VLOOKUP(E5,A:C,3,0))-1)),"")
 
Last edited:
Upvote 0
Vlookup(e5;$b$2:$d$4;3;false)/right(vlookup(e5;$b$2:$c$4;2;false);(len(vlookup(e5;$b$2:$c$4;2;false))-search("x";vlookup(e5;$b$2:$c$4;2;false);1)))/mid(vlookup(e5;$b$2:$c$4;2;false);find(" ";vlookup(e5;$b$2:$c$4;2;false);1)+1;(search("x";vlookup(e5;$b$2:$c$4;2;false);1)-find(" ";vlookup(e5;$b$2:$c$4;2;false);1)-1))
Hi Snackan, thanks for the help. I am getting popup errors with it. excel is saying "we found a problem with this formula" and its above my head, so im not even sure where to begin in an attempt to troubleshoot.
 
Upvote 0
Sorry mate, a bad copy and paste on my behalf (I had this in Column F originally).

In D5

=IFERROR(VLOOKUP(E5,A:D,4,0)/(MID(VLOOKUP(E5,A:C,3,0),FIND("X",VLOOKUP(E5,A:C,3,0))+1,4)*MID(VLOOKUP(E5,A:C,3,0),FIND(" ",VLOOKUP(E5,A:C,3,0))+1,FIND("X",VLOOKUP(E5,A:C,3,0))-FIND(" ",VLOOKUP(E5,A:C,3,0))-1)),"")
No errors on this one, but im not getting any output from it. It appears to be searching the correct columns, but im not sure why its coming up blank. I posted the code in column F ( empty column) and also tried in d in case you intended it to work in there.
 
Upvote 0

Forum statistics

Threads
1,215,373
Messages
6,124,544
Members
449,169
Latest member
mm424

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