Unique identifier in an array

toongal12

Board Regular
Joined
Dec 1, 2016
Messages
150
I need to create a formula that if compared with a date, it can tell me the most recent version of an item. So if I insert 8/12/16 for Item-001, it will return 2.

The dates and items are in no order

ItemCompleted DateVersion
Item-0019/1/163
Item-0016/1/121
Item-0017/1/142
Item-00210/1/171
Item-00211/1/181
Item-0029/1/16(cell is blank)
Date comparison8/12/16

<tbody>
</tbody>


My array is trying to output Version. Some items have the same date, so I make it match the last three digits of the Item to the date to create a "unique" identifier.

My problem is the identifier can sometimes match another item number and date combination, so now it doesn't work. I wasn't sure how to change it.



={INDEX(C2:C7,MATCH(RIGHT(A2,3)+LARGE(IF((A2:A7=A2)*(B2:B7<=C9),B2:B7),1),B2:B7+RIGHT(A2:A7,3),0))}
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
I don't understand wy 2 is the latest version in your example - please elaborate.
 
Upvote 0
I don't understand wy 2 is the latest version in your example - please elaborate.

So I want to know what latest version of Item-001 was out on 8/12/16

Item-001 has 3 dates: 9/1/16, 6/1/12, 7/1/14.

If compared to 8/12/16, the only date that has occured, that is the most recent is 7/1/14 (which has Version 2). 9/1/16 has not happened yet; therefore, not current version.
 
Upvote 0
Try

=INDEX(C2:C7,MATCH(1,IF(RIGHT(A2:A7,3)=A2,IF(B2:B7<=C9,1))))
Enter as an array
 
Upvote 0
It appears to work for me!

Code:
[TABLE="width: 455"]
<!--StartFragment--> <colgroup><col width="65" span="7" style="width:65pt"> </colgroup><tbody>[TR]
  [TD="width: 65"]Item[/TD]
  [TD="width: 65"]Completed Date[/TD]
  [TD="width: 65"]Version[/TD]
  [TD="width: 65"][/TD]
  [TD="width: 65"](cell is blank)[/TD]
  [TD="width: 65"]002[/TD]
  [TD="class: xl63, width: 65, align: right"]12/08/17[/TD]
 [/TR]
 [TR]
  [TD]Item-001[/TD]
  [TD="class: xl63, align: right"]01/09/16[/TD]
  [TD="align: right"]3[/TD]
  [TD][/TD]
  [TD][/TD]
  [TD][/TD]
  [TD][/TD]
 [/TR]
 [TR]
  [TD]Item-001[/TD]
  [TD="class: xl63, align: right"]01/06/12[/TD]
  [TD="align: right"]1[/TD]
  [TD][/TD]
  [TD][/TD]
  [TD][/TD]
  [TD][/TD]
 [/TR]
 [TR]
  [TD]Item-001[/TD]
  [TD="class: xl63, align: right"]01/07/14[/TD]
  [TD="align: right"]2[/TD]
  [TD][/TD]
  [TD][/TD]
  [TD][/TD]
  [TD][/TD]
 [/TR]
 [TR]
  [TD]Item-002[/TD]
  [TD="class: xl63, align: right"]01/10/17[/TD]
  [TD="align: right"]1[/TD]
  [TD][/TD]
  [TD][/TD]
  [TD][/TD]
  [TD][/TD]
 [/TR]
 [TR]
  [TD]Item-002[/TD]
  [TD="class: xl63, align: right"]01/11/18[/TD]
  [TD="align: right"]1[/TD]
  [TD][/TD]
  [TD][/TD]
  [TD][/TD]
  [TD][/TD]
 [/TR]
 [TR]
  [TD]Item-002[/TD]
  [TD="class: xl63, align: right"]01/09/16[/TD]
  [TD="colspan: 2"](cell is blank)[/TD]
  [TD][/TD]
  [TD][/TD]
  [TD][/TD]
 [/TR]
<!--EndFragment--></tbody>[/TABLE]

This part "B2:B7<=C9" will find the last value on or before the specified date.
 
Upvote 0
It appears to work for me!

Code:
[TABLE="width: 455"]
<tbody>[TR]
[TD="width: 65"]Item[/TD]
[TD="width: 65"]Completed Date[/TD]
[TD="width: 65"]Version[/TD]
[TD="width: 65"][/TD]
[TD="width: 65"](cell is blank)[/TD]
[TD="width: 65"]002[/TD]
[TD="class: xl63, width: 65, align: right"]12/08/17[/TD]
[/TR]
[TR]
[TD]Item-001[/TD]
[TD="class: xl63, align: right"]01/09/16[/TD]
[TD="align: right"]3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Item-001[/TD]
[TD="class: xl63, align: right"]01/06/12[/TD]
[TD="align: right"]1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Item-001[/TD]
[TD="class: xl63, align: right"]01/07/14[/TD]
[TD="align: right"]2[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Item-002[/TD]
[TD="class: xl63, align: right"]01/10/17[/TD]
[TD="align: right"]1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Item-002[/TD]
[TD="class: xl63, align: right"]01/11/18[/TD]
[TD="align: right"]1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Item-002[/TD]
[TD="class: xl63, align: right"]01/09/16[/TD]
[TD="colspan: 2"](cell is blank)[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

This part "B2:B7<=C9" will find the last value on or before the specified date.

I don't think it works?

If you enter 12/8/17 as the date, the answer for Item-002 should be 1, not (cell is blank). If 12/8/17 is the check date, the most current version is 1/10/17, not 1/9/16


Also be aware the data can be sorted and the order will be constantly changing.
 
Upvote 0

Forum statistics

Threads
1,214,666
Messages
6,120,806
Members
448,990
Latest member
rohitsomani

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