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.
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 | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
B | C | D | E | F | G | H | I | J | K | L | |||
1 | My Report | Customer Report | |||||||||||
2 | Customer PO | Order Number | Line # | Ship Date | PO Number | PO Line | Ship Date | ||||||
3 | 2433451 | 5051234 | 1 | 7/1/2022 | 2433451 | 1 | 7/1/2022 | ||||||
4 | 2433451 | 5051234 | 2 | 7/1/2022 | 2433451 | 2 | 7/1/2022 | ||||||
5 | 2433451 | 5051234 | 3 | 7/1/2022 | 2433451 | 3 | 7/1/2022 | ||||||
6 | 2433451 | 5051234 | 4 | 7/1/2022 | 2433451 | 4 | 7/1/2022 | ||||||
7 | 2433451 | 5051235 | 5 | 6/24/2022 | 2433451 | 5 | 6/24/2022 | ||||||
8 | 2433451 | 5051235 | 6 | 6/24/2022 | 2433451 | 6 | 6/24/2022 | ||||||
9 | 2433451 | 5051236 | 7 | 9/5/2022 | 2433451 | 7 | 9/5/2022 | ||||||
10 | 2433451 | 5051236 | 8 | 9/5/2022 | 2433451 | 8 | 9/5/2022 | ||||||
11 | 2433451 | 5051236 | 9 | 9/5/2022 | 2433451 | 9 | 9/5/2022 | ||||||
12 | 2433451 | 5051236 | 10 | 9/5/2022 | 2433451 | 10 | 9/5/2022 | ||||||
13 | 2433451 | 5051236 | 11 | 9/5/2022 | 2433451 | 11 | 9/5/2022 | ||||||
14 | 2433451 | 5051236 | 12 | 9/5/2022 | 2433451 | 12 | 9/5/2022 | ||||||
15 | 2433451 | 5051237 | 13 | 5/17/2022 | 2433451 | 13 | 5/17/2022 | ||||||
16 | 2433451 | 5051237 | 14 | 5/17/2022 | 2433451 | 14 | 5/17/2022 | ||||||
17 | 2433451 | 5051237 | 15 | 5/17/2022 | 2433451 | 15 | 5/17/2022 | ||||||
18 | 2433451 | 5051237 | 16 | 5/17/2022 | 2433451 | 16 | 5/17/2022 | ||||||
19 | 2433470 | 5051238 | 1 | 7/28/2022 | 2433470 | 1 | 7/28/2022 | ||||||
20 | 2433470 | 5051238 | 2 | 7/28/2022 | 2433470 | 2 | 7/28/2022 | ||||||
21 | 2433470 | 5051238 | 3 | 7/28/2022 | 2433470 | 3 | 7/28/2022 | ||||||
22 | 2433470 | 5051238 | 4 | 7/28/2022 | 2433470 | 4 | 7/28/2022 | ||||||
23 | 2433470 | 5051238 | 5 | 7/28/2022 | 2433470 | 5 | 7/28/2022 | ||||||
24 | 2433470 | 5051238 | 6 | 7/28/2022 | 2433470 | 6 | 7/28/2022 | ||||||
25 | 2433470 | 5051238 | 7 | 7/28/2022 | 2433470 | 7 | 7/28/2022 | ||||||
26 | 2433470 | 5051239 | 1 | 10/1/2022 | These should match customer PO Line | 2433470 | 8 | #N/A | |||||
27 | 2433470 | 5051239 | 2 | 10/1/2022 | 2433470 | 9 | #N/A | ||||||
28 | 2433470 | 5051239 | 3 | 10/1/2022 | 2433470 | 10 | #N/A | ||||||
29 | 2433470 | 5051239 | 4 | 10/1/2022 | 2433470 | 11 | #N/A | ||||||
30 | 2433470 | 4041240 | 1 | 6/17/2022 | 2433470 | 12 | #N/A | ||||||
31 | 2433470 | 5051240 | 2 | 6/17/2022 | 2433470 | 13 | #N/A | ||||||
32 | 2433470 | 5051240 | 3 | 6/17/2022 | 2433470 | 14 | #N/A | ||||||
Sheet1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
L3 | L3 | =INDEX($F$3:$F$32,MATCH(1,(J3=$C$3:$C$32)*(K3=$E$3:$E32),0)) |
L4:L32 | L4 | =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. |