Row number of largest match in list

Peterfc2

Active Member
Joined
Jan 2, 2004
Messages
394
Office Version
  1. 2013
Platform
  1. Windows
Col A. is a list dates. Col B. holds unique values. Col C. I need the row number of the match of B1 etc furthest down the list in Col A. Any ideas please?
Photo show how it should be.
data.JPG
 

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.
What version of Excel are you using?
Please update your account details to show this, as it affects which functions you can use.
 
Upvote 0
Thanks for that, how about
+Fluff v2.xlsm
ABC
119092020190920209
2190920202609202014
3190920202909202020
419092020
519092020
619092020
719092020
819092020
919092020
1026092020
1126092020
1226092020
1326092020
1426092020
1529092020
1629092020
1729092020
1829092020
1929092020
2029092020
21
Summary
Cell Formulas
RangeFormula
C1:C3C1=LOOKUP(B1,$A$1:$A$20,ROW($A$1:$A$20)-ROW($A$1)+1)
 
Upvote 0
Thanks for that, how about
+Fluff v2.xlsm
ABC
119092020190920209
2190920202609202014
3190920202909202020
419092020
519092020
619092020
719092020
819092020
919092020
1026092020
1126092020
1226092020
1326092020
1426092020
1529092020
1629092020
1729092020
1829092020
1929092020
2029092020
21
Summary
Cell Formulas
RangeFormula
C1:C3C1=LOOKUP(B1,$A$1:$A$20,ROW($A$1:$A$20)-ROW($A$1)+1)
Not working for me. Just get #N/A
 
Upvote 0
Are those numbers actual dates formatted as 29092020, are they numbers, or are they text?
 
Upvote 0
Are those numbers actual dates formatted as 29092020, are they numbers, or are they text?
They actually numbers in column A and text in col B. ( Changed to dates later). If I change col b to numbers I get 3102020 instead of 03102020. It misses the leading zero. Sorry to be so confusing.

This is the code to get uniques. Could that be altered to give the row of match maybe. (way beyond me)

VBA Code:
Dim d As Object, c As Variant, i As Long, LR As Long
Set d = CreateObject("Scripting.Dictionary")
LR = Cells(Rows.Count, 1).End(xlUp).Row
c = Range("a1:a" & LR)
For i = 1 To UBound(c, 1)
  d(c(i, 1)) = 1
Next i
Range("b1").Resize(d.Count) = Application.Transpose(d.keys)
 
Upvote 0
Try
VBA Code:
Dim d As Object, c As Variant, i As Long, LR As Long
Set d = CreateObject("Scripting.Dictionary")
LR = Cells(Rows.Count, 1).End(xlUp).Row
c = Range("a1:a" & LR)
For i = 1 To UBound(c, 1)
  d(c(i, 1)) = i
Next i
Range("b1").Resize(d.Count, 2) = Application.Transpose(Array(d.keys, d.Items))
 
Upvote 0
Solution
Try
VBA Code:
Dim d As Object, c As Variant, i As Long, LR As Long
Set d = CreateObject("Scripting.Dictionary")
LR = Cells(Rows.Count, 1).End(xlUp).Row
c = Range("a1:a" & LR)
For i = 1 To UBound(c, 1)
  d(c(i, 1)) = i
Next i
Range("b1").Resize(d.Count, 2) = Application.Transpose(Array(d.keys, d.Items))
Perfect. Just what I needed.
 
Upvote 0

Forum statistics

Threads
1,214,990
Messages
6,122,625
Members
449,093
Latest member
catterz66

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