+ Reply to Thread
Results 1 to 4 of 4

Populating units based on room numbers within a certain range

  1. #1
    Registered User
    Join Date
    05-20-2019
    Location
    Florida, US
    MS-Off Ver
    2018
    Posts
    23

    Populating units based on room numbers within a certain range

    Hello everyone,

    I am trying to automatically have units populate in the unit column based if the room is within a specific range. I have attached a small sample of what I am trying to do. Rooms 3000 – 3009 are unit 3N, 3010 – 3019 are for 3S, A120 – A129 are for unit 1E, M670 – M679 are for unit 6W and 8040 – 8050 are for unit 8NW. Thanks for the help!
    Attached Files Attached Files

  2. #2
    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,197

    Re: Populating units based on room numbers within a certain range

    Create named range "Room2Unit"

    in D2

    =IF(ISNUMBER($B2),VLOOKUP($B2,Room2Unit,2,1),VLOOKUP(--RIGHT($B2,3),Room2Unit,2,1))

    copy dowm
    Attached Files Attached Files
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  3. #3
    Registered User
    Join Date
    05-20-2019
    Location
    Florida, US
    MS-Off Ver
    2018
    Posts
    23

    Re: Populating units based on room numbers within a certain range

    Could you elaborate on how this works? I'm putting different room numbers and I'm not getting units that correspond to the room number.

  4. #4
    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,197

    Re: Populating units based on room numbers within a certain range

    What is not working: I have tried various room number and get the correct results.

    The table has to be in ascending order as in the file I posted as the VLOOKUP assumes data in ascending order. I "remove" the leading letter for "A" and "M" so it does a lookup on the numeric part.

    Post file with errors

+ 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. [SOLVED] Populating the part numbers based on Level numbers in multi level BoM
    By Sekars in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 01-03-2022, 04:12 AM
  2. Replies: 1
    Last Post: 05-29-2019, 12:48 AM
  3. [SOLVED] Populating prices based on part numbers in two different columns
    By aglawrence in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 11-07-2018, 08:15 AM
  4. [SOLVED] How to Calculate Hotel room nights booked, for each night, and broken down by room type?
    By salsadantzr in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 02-09-2018, 04:53 PM
  5. Room Allotment:remove allotted room from dropdown list
    By amdrosm in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 05-05-2017, 04:50 AM
  6. [SOLVED] Deleting units allocated in a range of cells based on the cell rank
    By LBala in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-07-2014, 12:36 AM
  7. Sorting Room numbers
    By kentvc in forum Excel General
    Replies: 1
    Last Post: 11-03-2010, 04:37 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