+ Reply to Thread
Results 1 to 12 of 12

How to populate certain cells based on another cell content [VLOOKUP ]

  1. #1
    Registered User
    Join Date
    04-02-2014
    Location
    Amsterdam
    MS-Off Ver
    Excel 2013
    Posts
    15

    How to populate certain cells based on another cell content [VLOOKUP ]

    Hi all,

    Is it possible to achieve the following scenario with the VLOOKUP formula?

    Basically this is a schedule where I want to populate the cells from E7 to E54 based on the selection of E5
    The cells should be populated with whats in E3

    Book1.xlsx

    Thank you

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,139

    Re: How to populate certain cells based on another cell content [VLOOKUP ]

    What should be in the cells if shift1 is selected at E5?
    What should be in the cells if shift2 is selected at E5?
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Registered User
    Join Date
    04-02-2014
    Location
    Amsterdam
    MS-Off Ver
    Excel 2013
    Posts
    15

    Re: How to populate certain cells based on another cell content [VLOOKUP ]

    It should display the agent code (what is on row line 5)

    Now something I miss to explain/add:
    The formula to add from E7 to E54 will be dependent on the E5

    For example: if agent SDC (E3) is scheduled for Shift 1 (E5) the E column will be populated with the agent code from 0:30 until 9:30
    Rest will be with nothing

    If Shift 2 is selected then it will populate from 04:00 till 11:00
    Last edited by exceleron; 07-21-2015 at 04:38 AM.

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,139

    Re: How to populate certain cells based on another cell content [VLOOKUP ]

    No - still not enough information, but it might be getting closer. Please confirm. Shift 1 = 00:30 to 09:30. Yes or No.
    Shift 2 = ???

    Other shifts??

  5. #5
    Registered User
    Join Date
    04-02-2014
    Location
    Amsterdam
    MS-Off Ver
    Excel 2013
    Posts
    15

    Re: How to populate certain cells based on another cell content [VLOOKUP ]

    I could add them later if I get the formula principle, either way they will be:

    * Only applicable to Site 1 (please see row 1 legend)
    Shift 1 = 00:00 to 09:00
    Shift 2 = 13:00 to 10:00

    * Only applicable to Site 2
    Shift 3 = 05:00 to 14:00
    Shift 4 = 07:00 to 16:00

    * Only applicable to Site 3
    Shift 5 = 08:00 to 16:30
    Shift 6 = 10:30 to 19:00
    Shift 7 = 13:45 to 22:45

    * Only applicable to Site 4
    Shift 8 = 12:00 to 21:00
    Shift 9 = 14:30 to 23:30
    Shift 10 = 16:00 to 01:00

  6. #6
    Registered User
    Join Date
    04-02-2014
    Location
    Amsterdam
    MS-Off Ver
    Excel 2013
    Posts
    15

    Re: How to populate certain cells based on another cell content [VLOOKUP ]

    is this too much?

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,139

    Re: How to populate certain cells based on another cell content [VLOOKUP ]

    Probably not... BUT. I've been moving furniture from house-to-house today and now I'm wrecked. It's also beer-o'clock so anything I do now might be more error-prone than normal. I'll be back in the morning and will take a look at this then....

  8. #8
    Registered User
    Join Date
    04-02-2014
    Location
    Amsterdam
    MS-Off Ver
    Excel 2013
    Posts
    15

    Re: How to populate certain cells based on another cell content [VLOOKUP ]

    Thanks Glenn

    Cheerio!

  9. #9
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,320

    Re: How to populate certain cells based on another cell content [VLOOKUP ]

    Try in E7 and copy down

    =IF(AND($E$5="Shift 1",D7>=TIME(0,0,0),D7<=TIME(9,0,0)),$E$3,IF(AND($E$5="Shift 2",D7>=TIME(13,0,0),D7<=TIME(22,0,0)),$E$3,""))

  10. #10
    Registered User
    Join Date
    04-02-2014
    Location
    Amsterdam
    MS-Off Ver
    Excel 2013
    Posts
    15

    Re: How to populate certain cells based on another cell content [VLOOKUP ]

    Awesome! It works John

    Now, for some reason If I want to adjust time of the schedule it automatically adjust to PM

    =IF(AND($E$5="Shift 1",D7>=TIME(0,0,0),D7<=TIME(9,0,0)),$E$3,IF(AND($E$5="Shift 2",D7>=TIME(13,0,0),D7<=TIME(22,0,0)),$E$3,""))

    What is in red I tried to adjust to start at 01 AM and finish at 10 AM but when I press enter it converts to PM

    How to avoid automatic conversion?


    Quote Originally Posted by JohnTopley View Post
    Try in E7 and copy down

    =IF(AND($E$5="Shift 1",D7>=TIME(0,0,0),D7<=TIME(9,0,0)),$E$3,IF(AND($E$5="Shift 2",D7>=TIME(13,0,0),D7<=TIME(22,0,0)),$E$3,""))

  11. #11
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,320

    Re: How to populate certain cells based on another cell content [VLOOKUP ]

    =IF(AND($E$5="Shift 1",D7>=TIME(0,0,0),D7<=TIME(9,0,0)),$E$3,IF(AND($E$5="Shift 2",D7>=TIME(1,0,0),D7<=TIME(10,0,0)),$E$3,""))

    See attached
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    04-02-2014
    Location
    Amsterdam
    MS-Off Ver
    Excel 2013
    Posts
    15

    Re: How to populate certain cells based on another cell content [VLOOKUP ]

    Awesome, thanks a bunch

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Macro to auto-populate cells based on content of other cells
    By BristolJGM in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-05-2015, 07:47 PM
  2. Vlookup based on two cells to populate from multiple sheets?
    By kellyfirth in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-07-2015, 02:07 PM
  3. Replies: 5
    Last Post: 07-07-2014, 11:52 AM
  4. Automatically copy cells content based on the content of another cell.
    By chrisbarlow1984 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-01-2014, 11:13 AM
  5. vlookup and sumif - based on cell content
    By ln2012 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-30-2013, 06:25 PM
  6. VLOOKUP based on cell content
    By garyi in forum Excel General
    Replies: 17
    Last Post: 02-27-2012, 09:44 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1