Determine order number based on multiple variables

arembr01

New Member
Joined
Feb 16, 2014
Messages
10
Quick back story: I need to report shipping dates to customers. I gather this information by doing a two way index match on the customers PO number and the customers PO line number against our line number. When entering items into our system the Import Team is supposed create an order number, fill with entered items (typically less than 15), create the next order number and repeat until all items are entered. A PO can as many order numbers as required. Additionally, the Import Team is supposed to use the customers PO line number as our PO line number continuing across all the jobs. I've pasted an example of a bad order entry in yellow and attached a file.

However, the Import Team is creating a new order number, entering items, and starting the line number sequence back to 1 with each new order.

I need to be able to check and see if the sequence is entered wrong (meaning no repeating line numbers for a given PO number). If its wrong, then I need to determine what the actual line number should be. My thought was finding the PO number, then finding the lowest order number, counting the lines, and continuing until I have my number. Meaning, for example: 4 jobs of 5 lines. My target is on job 4 line 2. It would count the jobs from the previous 3 (15 lines), then add the line value of job 4 (2) for a total of 17. Just dumping this value of 17 into another column is fine.

I feel like I have the right idea, but no clue how to make it all work. I also want to point out, the data will not always be filtered by any specific data field and I need this to also found cells that may be currently filtered out.

Sample File.xlsx
BCDEFGHIJKL
1My ReportCustomer Report
2Customer POOrder NumberLine #Ship DatePO NumberPO LineShip Date
32433451505123417/1/2022243345117/1/2022
42433451505123427/1/2022243345127/1/2022
52433451505123437/1/2022243345137/1/2022
62433451505123447/1/2022243345147/1/2022
72433451505123556/24/2022243345156/24/2022
82433451505123566/24/2022243345166/24/2022
92433451505123679/5/2022243345179/5/2022
102433451505123689/5/2022243345189/5/2022
112433451505123699/5/2022243345199/5/2022
1224334515051236109/5/20222433451109/5/2022
1324334515051236119/5/20222433451119/5/2022
1424334515051236129/5/20222433451129/5/2022
1524334515051237135/17/20222433451135/17/2022
1624334515051237145/17/20222433451145/17/2022
1724334515051237155/17/20222433451155/17/2022
1824334515051237165/17/20222433451165/17/2022
192433470505123817/28/2022243347017/28/2022
202433470505123827/28/2022243347027/28/2022
212433470505123837/28/2022243347037/28/2022
222433470505123847/28/2022243347047/28/2022
232433470505123857/28/2022243347057/28/2022
242433470505123867/28/2022243347067/28/2022
252433470505123877/28/2022243347077/28/2022
2624334705051239110/1/2022These should match customer PO Line24334708#N/A
2724334705051239210/1/202224334709#N/A
2824334705051239310/1/2022243347010#N/A
2924334705051239410/1/2022243347011#N/A
302433470404124016/17/2022243347012#N/A
312433470505124026/17/2022243347013#N/A
322433470505124036/17/2022243347014#N/A
Sheet1
Cell Formulas
RangeFormula
L3L3=INDEX($F$3:$F$32,MATCH(1,(J3=$C$3:$C$32)*(K3=$E$3:$E32),0))
L4:L32L4=INDEX($F$3:$F$32,MATCH(1,(J4=$C$3:$C$32)*(K4=$E$3:$E33),0))
Press CTRL+SHIFT+ENTER to enter array formulas.
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

Forum statistics

Threads
1,224,823
Messages
6,181,179
Members
453,021
Latest member
Justyna P

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