Index Match to find previous occurrence and call the second latest occurrence to a new cell

Razark88

New Member
Joined
Jul 20, 2021
Messages
2
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
Hello,

I m trying to find a way to pull the second newest revision to a cell. I got the first part of my issue , where indexing was used to find all previous occurrence( i found it out from another older thread in the forum) . Can someone help me find a way to call the the second latest revision to another cell.

The first image shows the part numbers from 1 to 4 having varying revision from A.1 to D.1

The second image shows the formula I have used to find the previous revision number of each part and show it against the Part number. ( Formula used to find previous occurrence = =IFERROR(INDEX($B$2:B3,AGGREGATE(14,6,(ROW($A$2:A3)-ROW($A$2)+1)/($A$2:A3=A3),2)),"") )

What I am looking for now is to find a way to pull the second latest revision automatically to another cell . (for example if we look at Part number "1", the latest revision is D.1, I want to figure out how to pull revision C.1 to another cell using a formula )

can anyone help please ?


(PS: as mentioned the formula is from an older thread of similar name made by user Willow1985 )
 

Attachments

  • Indexing occurance_Part Number & Revision .JPG
    Indexing occurance_Part Number & Revision .JPG
    37.2 KB · Views: 13
  • Indexing occurance_Part Number & Revisionwith formula to pull the previous revision .JPG
    Indexing occurance_Part Number & Revisionwith formula to pull the previous revision .JPG
    102 KB · Views: 19

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.
Formula Test.xlsx
ABCDE
1Part NumberRevPrevious Rev- formula 1 Previous Rev- formula 2Rev before the latest Rev
21A.1  I need to find a formula which will pull the revision before the latest one, i.e for Part Number 1, latest revision is E.1 , what can I do to pull D.1 as a result out of all 5 revision ?
32A.1  
43A.1  
54A.1  
61B.1A.1A.1
72B.1A.1A.1
83B.1A.1A.1
94B.1A.1A.1
101C.1B.1B.1
112C.1B.1B.1
123C.1B.1B.1
134C.1B.1B.1
141D.1C.1C.1
152D.1C.1C.1
163D.1C.1C.1
171E.1D.1D.1
PN Revision
Cell Formulas
RangeFormula
C2:C17C2=IFERROR(INDEX($B$2:B2,AGGREGATE(14,6,(ROW($A$2:A2)-ROW($A$2)+1)/($A$2:A2=A2),2)),"")
D2:D17D2=IFERROR(LOOKUP(2,1/($A$1:$A1=A2),$B$1:$B1),"")
 
Upvote 0
Hi & welcome to MrExcel.
How about
Excel Formula:
=IFERROR(INDEX($B$2:B$20,AGGREGATE(14,6,(ROW($A$2:A$20)-ROW($A$2)+1)/($A$2:A$20=A2),2)),"")
 
Upvote 0

Forum statistics

Threads
1,215,842
Messages
6,127,235
Members
449,372
Latest member
charlottedv

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