[Solved] First and last value

Shaima

New member
Good Day!
i want first and last value(time) of a given date in two different columns
im able to get the first value through vlookup with a helper column, but have trouble with the last value
Result
Helper ColumnNameDateTime in/OutFirst ValueLast Value
Young|45068Young22/05/20238.24.018.24.0117.35.59
Young|45068Young22/05/202317.35.59
Young|45069Young23/05/20238.20.478.20.4717.24.43
Young|45069Young23/05/202317.18.13
Young|45069Young23/05/202317.24.43
i have attached excel file, please provide solution for the above query.
 

Attachments

  • First Last Value.xlsx
    12.6 KB · Views: 1
Good Day!
i want first and last value(time) of a given date in two different columns
im able to get the first value through vlookup with a helper column, but have trouble with the last value
Result
Helper ColumnNameDateTime in/OutFirst ValueLast Value
Young|45068Young22/05/20238.24.018.24.0117.35.59
Young|45068Young22/05/202317.35.59
Young|45069Young23/05/20238.20.478.20.4717.24.43
Young|45069Young23/05/202317.18.13
Young|45069Young23/05/202317.24.43
i have attached excel file, please provide solution for the above query.
Dear Shaima,

Thank you for your query. I understand you wish to extract the first and last matches from Column D based on multiple criteria. I see you used VLOOKUP to get the first value with a helper column. But you were not able to obtain the last matching value. This is so common because VLOOKUP only returns the first matching value. Fortunately, we can get the last matching value using the LOOKUP value.

Here are the desired formulas:
To get the entry time:
=VLOOKUP(A4, $A$4:$D$91, 4, FALSE)
For exit time:
=LOOKUP(2, 1/(($A$4:$A$91=A4)*($D$4:$D$91<>"")), $D$4:$D$91)

Thus, you will obtain the desired outputs. I have attached the Excel file as well for a better understanding.

Best Regards,
Yousuf Shovon
 

Attachments

  • First Last Value.xlsx
    16.2 KB · Views: 3

Online statistics

Members online
0
Guests online
3
Total visitors
3

Forum statistics

Threads
306
Messages
1,351
Members
557
Latest member
RSntg
Top