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:
https://ibb.co/mqksNb

Is this what you are seeing?

Is the formula in row 5? (headers in row 1)

Works now, thanks Mrshl. I had simplified my template to make an easy to read example on here. I pasted the example directly into excel when testing your code, and had the column with Row#s on there.... Thanks for pushing it back and letting me know it works. From here Ill try and modify it so it works in my longer master list.
Thank you for all your help!
 
Upvote 0

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
solidENM,

Just be mindful that the above solution will not give the expected result if your description has any other spaces preceding the one before the **X****. Or if there is a preceding "X" in the description.
 
Last edited:
Upvote 0
Just in case it helps, the below should take care of the issue if preceding spaces are likely to give you a problem. Also it will allow for box and piece quantities to be other than **X****. eg ****X**
Edit the range lower limit from 1000 to a sensible max for your data set.


Excel 2010
ABCDEF
1Part NumberDescriptionPriceBulk # (if appl)Piece prices
256985523625 698 552 362Xtra yellow 20X56004312.25 
356985523735 698 552 373Green 20X60001945.25
456985523845 698 552 384red 20X60702525.12
565745523456 574 552 345Xtra yellow piece56985523620.038502
665745523566 574 552 356green piece56985523730.016210
765745523676 574 552 367red piece56985523840.020800
Sheet3
Cell Formulas
RangeFormula
F2=IFERROR(VLOOKUP(E2,$A$1:$D$1000,4,0)/RIGHT(SUBSTITUTE(TRIM(RIGHT(SUBSTITUTE(VLOOKUP(E2,$A$1:$C$1000,3,0)," ",REPT(" ",99)),20)),"X",REPT(" ",10)),10)/LEFT(SUBSTITUTE(TRIM(RIGHT(SUBSTITUTE(VLOOKUP(E2,$A$1:$C$1000,3,0)," ",REPT(" ",99)),20)),"X",REPT(" ",10)),10)," ")


Hope that helps.
 
Upvote 0

Forum statistics

Threads
1,216,038
Messages
6,128,450
Members
449,453
Latest member
jayeshw

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