Enter formula on last unique value

CaptainGravyBum

Board Regular
Joined
Dec 1, 2023
Messages
77
Office Version
  1. 365
Platform
  1. Windows
Once again, I'm stuck on something that's probably simple, but I've been staring at my screen for an hour trying to figure it out.
I need to put a formula in column k on the last unique row (highest count) of the order id - calculated in column I. Column H is already populating only on the bottom row, but that is because it is relying on information from other counts on the sheet (I haven't included all formulas and columns, because it's extensive).

Book1.xlsx
ABCDEFGHIJK
1Article numberOrder IDDelivery dateCarton QtyPallet QtyWeight CountPalletsUniqueOrder Count TotalUnique Cons
2PBB12T10991629/05/2024255503855501 
3PBB12T10991629/05/2024255503855502211001
Sheet1
Cell Formulas
RangeFormula
I2I2=IF(B2<>"",IF(COUNTIF($B$2:$B$499,B2)>=2,COUNTIF($B2:$B$2,B2),""),"")
I3I3=IF(B3<>"",IF(COUNTIF($B$2:$B$499,B3)>=2,COUNTIF($B$2:$B3,B3),""),"")
K2:K3K2=IF(AND(H3="", OR(I3="", I3=1)), 1, "")
Cells with Conditional Formatting
CellConditionCell FormatStop If True
I2:I3Expression=I2<>""textNO
I2:I3Expression=#REF!<>""textNO
H2:H3Expression=H2<>""textNO
H2:H3Expression=#REF!<>""textNO
J2:J3Expression=J2<>""textNO
K2:K3Expression=K2<>""textNO
A2:G3,J2:K3Expression=#REF!<>""textNO
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Try this:

Book1
ABCDEFGHIJK
1Article numberOrder IDDelivery dateCarton QtyPallet QtyWeight CountPalletsUniqueOrder Count TotalUnique Cons
2PBB12T10991629/5/202425550385550 1 
3PBB12T10991629/5/2024255503855502211001
Sheet1
Cell Formulas
RangeFormula
H2H2=LET(a,COUNTIF($B$2:$B$499,B2),IF(B2<>"",IF(COUNTIF($B2:$B$2,B2)=a,a,""),""))
I2I2=IF(B2<>"",COUNTIF($B2:$B$2,B2),"")
H3H3=LET(a,COUNTIF($B$2:$B$499,B3),IF(B3<>"",IF(COUNTIF($B$2:$B3,B3)=a,a,""),""))
I3I3=IF(B3<>"",COUNTIF($B$2:$B3,B3),"")
K2:K3K2=IF(H2="", "", 1)
 
Upvote 0
Hi @Phuoc,
Thanks for the reply, however that's very similar to the place I had got to already.
The formula I need is kind of the reverse to your suggestion, I didn't explain it well.

If column H is populated, then the result will be always be "" anyway, but I don't want the other parts of my formula to run unless the unique count in column I is the last/highest number.
So I mean, there are counts running which give the result in the last unique row, so that's the row where my column K formula needs to work.

So, find the last unique row in column I and run some other formula in column K.
 
Upvote 0

Forum statistics

Threads
1,223,879
Messages
6,175,148
Members
452,615
Latest member
bogeys2birdies

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