Vlookup a specific time and return name only if specific time is between a range of Current Time

Lacan

Board Regular
Joined
Oct 5, 2016
Messages
163
Office Version
  1. 365
Platform
  1. Windows
Hi Guys,

Here is the challenge, have this table:


09:00 Jen
10:00 Frank
11:00 Tom
12:00 Hannah


The goal is to Vlookup time in column A and return name in column B only if the time in column A is between range of +20 minutes of current time and -20 minutes of current time.


Can you help me?


Thanks to all.
 
Dear @DanteAmor

First thank you very much for your fast reply.🙏👍👍
Im not sure want Im doing incorrect because it is not working with me.
As initially in C2 want to return the exact name in column B2:B16 which match between now time -00:30 and +00:30.
Can you please give a check?
Thank you very much.

Livros Brasil.xlsx
ABCDE
1TimeNAMEName Current TimeCurrent Time
209HName1without coincidences20:24:08
310HName2
411HName3
512HName4
613HName5
714HName6
815HName7
916HName8
1017HName9
1118HName10
1219HName11
1320HName12
1421HName13
1522HName14
1623HName15
17
18
Folha2
 
Upvote 0

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Give this a try.
BTW, when using XL2BB with formulas, best to tick the 'Cell formulas' box so we can easily see the formulas under the worksheet.

1708302081657.png


24 02 19.xlsm
ABCD
1TimeNAMEName Current TimeCurrent Time
209HName1Name219/02/2024 11:19
310HName2
411HName3
512HName4
613HName5
714HName6
815HName7
916HName8
1017HName9
1118HName10
1219HName11
1320HName12
1421HName13
1522HName14
1623HName15
Lookup time
Cell Formulas
RangeFormula
C2C2=LET(strt,HOUR(MOD(NOW()-"00:30",1)),h,LEFT(A2:A16,2)+0,INDEX(FILTER(B2:B16,(h>=strt)*(h<=strt+1),"without coincidences"),1))
D2D2=NOW()
 
Upvote 0
Solution
Give this a try.
BTW, when using XL2BB with formulas, best to tick the 'Cell formulas' box so we can easily see the formulas under the worksheet.

View attachment 107052

24 02 19.xlsm
ABCD
1TimeNAMEName Current TimeCurrent Time
209HName1Name219/02/2024 11:19
310HName2
411HName3
512HName4
613HName5
714HName6
815HName7
916HName8
1017HName9
1118HName10
1219HName11
1320HName12
1421HName13
1522HName14
1623HName15
Lookup time
Cell Formulas
RangeFormula
C2C2=LET(strt,HOUR(MOD(NOW()-"00:30",1)),h,LEFT(A2:A16,2)+0,INDEX(FILTER(B2:B16,(h>=strt)*(h<=strt+1),"without coincidences"),1))
D2D2=NOW()

Dear @Peter_SSs

Nice to hear from you Im glad you are ok.👍👌
Sure will record the note of XL2BB.
Formula above works perfect will give some tests tomorrow.
If need some adjustments will let you know.
Thank you very much!!! 🔝💪🍻
 
Upvote 0
You're welcome. Hope it continues to work for you. Thanks for the follow-up. :)
 
Upvote 0

Forum statistics

Threads
1,215,208
Messages
6,123,644
Members
449,111
Latest member
ghennedy

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