Find last occurrence of each unique value in column

dazed007

New Member
Joined
Apr 28, 2015
Messages
10
Hello, hoping this is straight forward but having spent quite a while searching I'm struggling to find exactly what I'm looking for.

Please could someone provide a formula to go into column B to show the last occurrence for each unique value in column A.

For example:

AB
BN1
BN2
BN1
BN4Yes
BN3
BN3Yes
BN2Yes
BN1
BN1Yes

<tbody>
</tbody>

Thanks.
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Hi.

Assuming your list is in A1:A9, this array formula** in B1:

=REPT("Yes",ROWS($1:1)=MATCH(1,0/(A$1:A$9=A1)))

Copy down as required.

Note that you can amend the upper range reference (A9 here) to an appropriately larger value as required.

However, since this is an array formula, you should know that you cannot make it arbitrarily large without any detriment to performance: each cell referenced, whether beyond your last-used cell in that range or not, will be calculated. Using A:A here, for example, would not be a very good idea!

Regards


**Array formulas are not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).
 
Upvote 0
Working!

Thanks and understood, it seems to be behaving OK, the range is in a table which looks to be working dynamically so all good cheers.
 
Upvote 0

Forum statistics

Threads
1,215,350
Messages
6,124,439
Members
449,160
Latest member
nikijon

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