Distinct date range for users

Steve Saunders

New Member
Joined
Jun 18, 2023
Messages
12
Office Version
  1. 365
Platform
  1. Windows
Hi all,

I have over 600 rows of user data and am looking for a way to determine the first distinct date range for each user. In the example sheet, Sally has three dates all of which are the same, but I only want the first to be marked as distinct. Eduarado has only one so this is distinct, and Jimmy has two dates and the first is to be marked as distinct. I want to determine this for each row and user with a “Y/N" result so I can then perform further calculations.

I can get a listing of distinct values from the dates in column B and C, but can't use the username as an additional criterion. Does anyone have suggestions as to where I could look?

Regards,
Steve


Sample.xlsx
ABCD
1UserStartFinishIs distinct date?
2Sally13/08/202314/02/2023Y
3Eduarado1/01/202218/10/2022Y
4Jimmy2/02/20238/08/2023Y
5Sally13/08/202314/02/2023N
6Sally13/08/202314/02/2023N
7Jimmy2/02/20238/08/2023N
Sheet1
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
If you have no way of distinguishing which row belongs to which name then you cannot get distinct by name unless you use the name.
Can you give more details on your scenario as to why you cannot use values of another column to distinguish one date from another?
The only thing that could make it possible without using the name is that there is only one name with a date. In other words it is not possible in your scenario for Jimmy to have a date of 13/08/2023 - if this is true then you just need to get unique values of each date. UNIQUE($B$2:$B$7)
 
Upvote 0
Like this?

23 11 07.xlsm
ABCD
1UserStartFinishIs distinct date?
2Sally13/08/202314/02/2023Y
3Eduarado1/01/202218/10/2022Y
4Jimmy2/02/20238/08/2023Y
5Sally13/08/202314/02/2023N
6Sally13/08/202314/02/2023N
7Jimmy2/02/20238/08/2023N
Distinct
Cell Formulas
RangeFormula
D2:D7D2=IF(COUNTIFS(A$2:A2,A2,B$2:B2,B2,C$2:C2,C2)=1,"Y","N")


If you just wanted the list elsewhere ..

23 11 07.xlsm
ABCIJKL
1UserStartFinishUserStartFinish
2Sally13/08/202314/02/2023Sally13/08/202314/02/2023
3Eduarado1/01/202218/10/2022Eduarado1/01/202218/10/2022
4Jimmy2/02/20238/08/2023Jimmy2/02/20238/08/2023
5Sally13/08/202314/02/2023
6Sally13/08/202314/02/2023
7Jimmy2/02/20238/08/2023
8
Distinct
Cell Formulas
RangeFormula
J1:L4J1=UNIQUE(A1:C7)
Dynamic array formulas.
 
Upvote 1
Like this?

23 11 07.xlsm
ABCD
1UserStartFinishIs distinct date?
2Sally13/08/202314/02/2023Y
3Eduarado1/01/202218/10/2022Y
4Jimmy2/02/20238/08/2023Y
5Sally13/08/202314/02/2023N
6Sally13/08/202314/02/2023N
7Jimmy2/02/20238/08/2023N
Distinct
Cell Formulas
RangeFormula
D2:D7D2=IF(COUNTIFS(A$2:A2,A2,B$2:B2,B2,C$2:C2,C2)=1,"Y","N")


If you just wanted the list elsewhere ..

23 11 07.xlsm
ABCIJKL
1UserStartFinishUserStartFinish
2Sally13/08/202314/02/2023Sally13/08/202314/02/2023
3Eduarado1/01/202218/10/2022Eduarado1/01/202218/10/2022
4Jimmy2/02/20238/08/2023Jimmy2/02/20238/08/2023
5Sally13/08/202314/02/2023
6Sally13/08/202314/02/2023
7Jimmy2/02/20238/08/2023
8
Distinct
Cell Formulas
RangeFormula
J1:L4J1=UNIQUE(A1:C7)
Dynamic array formulas.
Exactly like this Peter - thank you so much! The step I was missing was the intermediary calculation (for lack of a better term) of "=1" and I'd never have thought of it!
 
Upvote 0
You're welcome. Thanks for the follow-up. :)

BTW, if you didn't want to copy the formula down the column you could get the values like this.
Longer formula - but it only needs to go in the top cell and not copied down.

23 11 07.xlsm
ABCD
1UserStartFinishIs distinct date?
2Sally14/08/202715/02/2027Y
3Eduarado2/01/202619/10/2026Y
4Jimmy3/02/20279/08/2027Y
5Sally14/08/202715/02/2027N
6Sally14/08/202715/02/2027N
7Jimmy3/02/20279/08/2027N
Distinct
Cell Formulas
RangeFormula
D2:D7D2=BYROW(A2:C7,LAMBDA(rw,LET(a,INDEX(rw,1),b,INDEX(rw,2),c,INDEX(rw,3),IF(COUNTIFS(A$2:a,a,B$2:b,b,C$2:c,c)=1,"Y","N"))))
Dynamic array formulas.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,324
Members
452,635
Latest member
laura12345

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