How to find the 5th occurrence and return the date and location information?

schappelljr

Board Regular
Joined
Feb 2, 2009
Messages
55
I’ve been stuck on this problem for a while now. I have a large spreadsheet that I am trying to find when and where the 5th occurrence happens. I would like to use a helper column to display the values if not a list of the location and time would work. Below is an example.




<tbody>
</tbody>
unique IDDateLocation5th location5th Date
Steve25801/2/19Store 1
Steve25801/5/19Store 3
Amanda16651/9/19Store 2
Nikki55661/15/19Store 6
Steve25801/18/19Store 7
Courtney44441/20/19Store 2
Steve25801/22/19Store 4
Kevin55321/23/19Store 3
Steve25801/26/19Store 7Store 71/26/19
Frank66771/27/19Store 2
Steve25802/1/19Store 1
Steve25802/15/19Store 1
Xavier2/17/19Store 20

<tbody>
</tbody>
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Like this?

ABCDEF
1unique IDDateLocation5th location5th Date
2Steve25801/2/2019Store 1
3Steve25801/5/2019Store 3
4Amanda16651/9/2019Store 2
5Nikki55661/15/2019Store 6
6Steve25801/18/2019Store 7
7Courtney44441/20/2019Store 2
8Steve25801/22/2019Store 4
9Kevin55321/23/2019Store 3
10Steve25801/26/2019Store 7Store 71/26/2019
11d>Frank66771/27/2019Store 2
12Steve25802/1/2019Store 1
13Steve25802/15/2019Store 1
14Xavier2/17/2019Store 20

<tbody>
</tbody>
Sheet6

Worksheet Formulas
CellFormula
D2=IF(COUNTIF($A$2:$A2,$A2)=5,C2,"")
E2=IF(COUNTIF($A$2:$A2,$A2)=5,B2,"")

<tbody>
</tbody>

<tbody>
</tbody>
 
Last edited:
Upvote 0
A quick way would be to simply click on Unique ID and then go to the Data tab and select Filter.

You can then select the ID you want and count down five. That's quick but not what you want.

HTH Don
 
Upvote 0
When I looked at this post Eric W had not posted yet, by the time I hit post quick reply he had, and he had a better way.

dang slow internet....
 
Upvote 0
If you're interested in a list, without helper columns, maybe Advanced Filter + a formula as criteria.

Something like this

A
B
C
D
E
F
G
H
I
1
unique ID​
Date​
Location​
unique ID​
Date​
Location​
2
Steve2580​
1/2/2019​
Store 1​
Steve2580​
1/26/2019​
Store 7​
FALSE​
3
Steve2580​
1/5/2019​
Store 3​
Nikki5566​
2/22/2019​
Store6​
4
Amanda1665​
1/9/2019​
Store 2​
5
Nikki5566​
1/15/2019​
Store 6​
6
Steve2580​
1/18/2019​
Store 7​
7
Courtney4444​
1/20/2019​
Store 2​
8
Steve2580​
1/22/2019​
Store 4​
9
Kevin5532​
1/23/2019​
Store 3​
10
Steve2580​
1/26/2019​
Store 7​
11
Frank6677​
1/27/2019​
Store 2​
12
Steve2580​
2/1/2019​
Store 1​
13
Steve2580​
2/15/2019​
Store 1​
14
Xavier​
2/17/2019​
Store 20​
15
Nikki5566​
2/18/2019​
Store 3​
16
Xavier​
2/19/2019​
Store 7​
17
Nikki5566​
2/20/2019​
Store 2​
18
Nikki5566​
2/21/2019​
Store 1​
19
Nikki5566​
2/22/2019​
Store6​
20

<tbody>
</tbody>


Leave I1 empty
Formula in I2
=COUNTIF(A$2:A2,A2)=5

Select your data range including headers (A1:C19)

Data > Advanced Filter
check Copy to another location
List Range: $A$1:$C$19
Criteria Range: $I$1:$I$2
Copy to: $E$1

M.
 
Upvote 0
Like this?

ABCDEF
1unique IDDateLocation5th location5th Date
2Steve25801/2/2019Store 1
3Steve25801/5/2019Store 3
4Amanda16651/9/2019Store 2
5Nikki55661/15/2019Store 6
6Steve25801/18/2019Store 7
7Courtney44441/20/2019Store 2
8Steve25801/22/2019Store 4
9Kevin55321/23/2019Store 3
10Steve25801/26/2019Store 7Store 71/26/2019
11d>Frank66771/27/2019Store 2
12Steve25802/1/2019Store 1
13Steve25802/15/2019Store 1
14Xavier2/17/2019Store 20

<tbody>
</tbody>
Sheet6

Worksheet Formulas
CellFormula
D2=IF(COUNTIF($A$2:$A2,$A2)=5,C2,"")
E2=IF(COUNTIF($A$2:$A2,$A2)=5,B2,"")

<tbody>
</tbody>

<tbody>
</tbody>

Thank you!
 
Upvote 0

Forum statistics

Threads
1,213,531
Messages
6,114,172
Members
448,554
Latest member
Gleisner2

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