+ Reply to Thread
Results 1 to 7 of 7

Help needed with VLOOKUP to fill in cells automatically but with exceptions

  1. #1
    Registered User
    Join Date
    12-16-2020
    Location
    Texas
    MS-Off Ver
    2013
    Posts
    8

    Question Help needed with VLOOKUP to fill in cells automatically but with exceptions

    I'm using a really basic example to try and ask this question and figure out what formula I need. But basically - in the attachment on the "Sample" worksheet - if I type someone's name in Column A, a number automatically appears in Column B. That's what I want. HOWEVER, if there is a value in either Columns 1 or 2, I want a different number to appear. Or for the cell to just return blank. What do I need to accomplish this?

    **********OK - TRYING THIS AGAIN. I am new here and there are so many rules for how to even post, so bear with me.

    I can't share my actual spreadsheet because it contains sensitive information so I tried to re-create what I need in this sample worksheet. If you look at the worksheet called "SAMPLE" - Column "B" will automatically fill in with the corresponding person's code (found on the CODES worksheet) as I type people's names in. However, what I want is for that code to fill in UNLESS there's something in either column C or D. If something is in Column C, I want the code to be "1111" and if something is in Column D, I want the code to be "2222." Does this help? Attached is an updated spreadsheet.
    Attached Files Attached Files
    Last edited by GenesisSZG; 01-15-2021 at 10:42 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Vlookup help

    What different number do you want to appear? Provide a few examples.

    In future, please give your threads more descriptive titles - this one could do with improvement, please, as it is too generic.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    12-16-2020
    Location
    Texas
    MS-Off Ver
    2013
    Posts
    8

    Re: Vlookup help

    Let's just say if something is in Column 1, I want the code that automatically fills in to be "100" and if something is in Column 2, then "200."

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Vlookup help

    Please update the thread title, as requested. Then provide a workbook that shows what you want, not a formula that does not give the desired result.

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Vlookup help

    Also, your formula is only coincidently giving the correct answers...
    =VLOOKUP(A2,CODES!A1:B4,2,FALSE)
    You need to "absolute" the range refs so they dont change as you copy down...
    =VLOOKUP(A2,CODES!$A$1:$B$4,2,FALSE)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Vlookup help

    I was hoping the OP would update the thread title - I don 't understand the requirements well enough to suggest a good title.

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Vlookup help

    I agree, the title is vague, but the question is even more so

+ 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. Replies: 1
    Last Post: 12-08-2020, 05:16 AM
  2. Replies: 5
    Last Post: 12-07-2016, 09:18 AM
  3. Replies: 0
    Last Post: 12-26-2013, 01:12 PM
  4. Display Cell within VLookup range that excel thinks matches the VLookup Value
    By headachexcelperson in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-04-2013, 04:56 PM
  5. [SOLVED] Vlookup is not working and giving =vlookup(B2,$T$2:$U$135,2,false) this kind of values.
    By yogeshsharma1981 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-09-2013, 04:08 PM
  6. vlookup? match? index? MULTIPLE criteria for vlookup search problem....
    By aborg88 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 02-11-2013, 09:56 AM
  7. Replies: 5
    Last Post: 07-29-2009, 07:53 AM

Tags for this Thread

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