Comparing last step to current row

Pestomania

Active Member
Joined
May 30, 2018
Messages
332
Office Version
  1. 365
Platform
  1. Windows
I am trying to identify a way to develop a formula which allows me to "scan" all of the work tickets and identify if the row I am on is before or after the last step scanned.

I.e. Step 10 is less than Step 30 which was scanned on 1/3/2023. Anything before Step 30 should be reviewed.



Book1
ABCDEFG
1Work Ticket NumberStep NumberDate ScannedLast Step ScannedShould I review?
21101/1/20231 - 30YesThe rule is: If a step 30 has been scanned but step 20 has not, step 20 needs to be reviewed for accuracy.
31201 - 30Yes
41301/3/20231 - 30YesWhat I need help determining is "what is the last step scanned on the unique work ticket and is that row prior to that last step"?
51401 - 30No
612103/1/202312 - 50Yes
7122012 - 50Yes
8123012 - 50Yes
9124012 - 50Yes
1012503/3/202312 - 50Yes
11126012 - 50No
Sheet1
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
How about
Excel Formula:
=IF(COUNTIFS(A:A,A2)>COUNTIFS(A$2:A2,A2),"Yes","No")
 
Upvote 0
How about
Excel Formula:
=IF(COUNTIFS(A:A,A2)>COUNTIFS(A$2:A2,A2),"Yes","No")
I couldn't get this one to work or how to fix it if I was messing it up. But I did notice in my data table, the "Date Updated" is pretty much not helpful.

I have added a different form of the same table. Essentially, it identifies the last step that has a status code of "Not New". In this case, the greatest step is 00170. It then says "yes it is less than 170 and to review"

Book1
ABCDEF
1WorkTicketNoStepNoDateUpdatedStatusCodeMax Step ScannedIs this Step less than 170?
20000000222430000103/28/2023 0:00NEW170Yes
30000000222430000313/28/2023 0:00COM170Yes
40000000222430000313/28/2023 0:00COM170Yes
50000000222430000703/28/2023 0:00COM170Yes
60000000222430000913/28/2023 0:00COM170Yes
70000000222430000913/28/2023 0:00COM170Yes
80000000222430001003/28/2023 0:00COM170Yes
90000000222430001203/28/2023 0:00NEW170Yes
100000000222430001613/28/2023 0:00COM170Yes
110000000222430001613/28/2023 0:00COM170Yes
120000000222430001703/28/2023 0:00COM170No
130000000222430001903/28/2023 0:00NEW170No
140000000222430002113/28/2023 0:00NEW170No
150000000222430002113/28/2023 0:00NEW170No
160000000222430002203/28/2023 0:00NEW170No
170000000222430002403/28/2023 0:00NEW170No
180000000222430002613/28/2023 0:00NEW170No
190000000222430002613/28/2023 0:00NEW170No
200000000222430002703/28/2023 0:00NEW170No
210000000222430002903/28/2023 0:00NEW170No
Sheet1
 
Upvote 0
Glad you sorted it & thanks for letting us know.
 
Upvote 0
Glad you sorted it & thanks for letting us know.
Sorry, I manually typed these in. I am trying to identify how to complete this using a formula. That was a confusing statement, my apologies.
 
Upvote 0
Do you have col E & just looking for col F?
 
Upvote 0
Then how do you calculate the the max step is 170?
 
Upvote 0
Then how do you calculate the the max step is 170?
The max step is the maximum step number which has a statuscode that does not equal new. The above data set is only one work ticket which in reality will be thousands in the table.

In the information above, step 170 has a status code of "COM" and everything greater is set to "New" which we do not want to consider.

If only dealing with one work ticket, you could consider:

Book1
ABCDE
27000000022243000010NEW Yes
28000000022243000031COM22243000031Yes
29000000022243000031COM22243000031Yes
30000000022243000070COM22243000070Yes
31000000022243000091COM22243000091Yes
32000000022243000091COM22243000091Yes
33000000022243000100COM22243000100Yes
34000000022243000120NEW Yes
35000000022243000161COM22243000161Yes
36000000022243000161COM22243000161Yes
37000000022243000170COM22243000170No
38000000022243000190NEW No
39000000022243000211NEW No
40000000022243000211NEW No
41000000022243000220NEW No
42000000022243000240NEW No
43000000022243000261NEW No
44000000022243000261NEW No
45000000022243000270NEW No
46000000022243000290NEW No
Sheet1
Cell Formulas
RangeFormula
D27:D46D27=IF(C27<>"New",CONCATENATE(A27,B27)*1,"")
E27:E46E27=IF(CONCATENATE(A27,B27)*1<MAX($D$27:$D$46),"Yes","No")



In this table, it is identifying the "concatenated fields" of each row and then identifies if the current row is less than the "max" concatenated field.

I am unfortunately not great with the match and index formulas to be able to run this on thousands of individual work tickets in the table to tell it to only look at the work tickets that match the current column A row.
 
Upvote 0
Ok, how about
Fluff.xlsm
ABCDEF
1WorkTicketNoStepNoDateUpdatedStatusCodeMax Step ScannedIs this Step less than 170?
2222431045013NEWyes
3222433145013COMyes
4222433145013COMyes
5222437045013COMyes
6222439145013COMyes
7222439145013COMyes
82224310045013COMyes
92224312045013NEWyes
102224316145013COMyes
112224316145013COMyes
122224317045013COMNo
132224319045013NEWNo
142224321145013NEWNo
152224321145013NEWNo
162224322045013NEWNo
172224324045013NEWNo
182224326145013NEWNo
192224326145013NEWNo
202224327045013NEWNo
212224329045013NEWNo
Sheet4
Cell Formulas
RangeFormula
F2:F21F2=IF(B2<MAXIFS(B:B,A:A,A2,D:D,"<>New"),"yes","No")
 
Upvote 0

Forum statistics

Threads
1,223,958
Messages
6,175,638
Members
452,663
Latest member
MEMEH

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