+ Reply to Thread
Results 1 to 7 of 7

Need help with Vlookup or a formula that fills out a cell automatically depending on input

  1. #1
    Registered User
    Join Date
    12-20-2019
    Location
    Houston
    MS-Off Ver
    Office 2010
    Posts
    8

    Need help with Vlookup or a formula that fills out a cell automatically depending on input

    I have a spreadsheet that I am lost if ifs a Vlookup function or different formula,

    In sheet1 on the K column I want to write a number that's affiliated with a specific code from the numbers and texts that are on sheet2, so if I put "1100" on K2, I want L2 to be filled with the appropriate text for that code.
    Also is it possible to write depending on the code I entered on K2, to write "YES" or "NO" on M2 and color code it depending on the answer?
    i.e:

    K2: I'll enter "1100", then on L2 will write "LAE -tires" (coming from B2 on sheet2) then on M2 write NO and color code that cell in blue.

    So I tried Vlookup but I can only write the text part but the number will disappear and to write YES or NO part was out of my knowledge .

    Did I make sense?
    Attached Files Attached Files
    Last edited by LionDragon; 12-27-2019 at 05:23 PM.

  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,853

    Re: Is it Vlookup or a complex formula?

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however the thread title does not really convey what your request is about.

    Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    (Note: this change is not optional. Normally, as you are new, I'd do this for you, however your description is not clear enough for me to do so - sorry - and your workbook does not make anything any clearer. You will have to come up with something better yourself, please.)
    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-20-2019
    Location
    Houston
    MS-Off Ver
    Office 2010
    Posts
    8

    Re: Is it Vlookup or a complex formula?

    Thanks AliGW, I corrected it already, hopefully it'll make sense.

  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,853

    Re: Need help with Vlookup or a formula that fills out a cell automatically depending on i

    Thank you.

  5. #5
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,831

    Re: Need help with Vlookup or a formula that fills out a cell automatically depending on i

    You can use VLookup, but I prefer Index/Match because it's a bit more flexible. In cell L2, you can enter this formula:
    =IFERROR(INDEX(Sheet2!$B$1:$B$11,MATCH(K2,Sheet2!$A$1:$A$11,0)),"")

    To color code column M, use conditional formatting as shown in attached. I don't know if you wanted the "Yes" or "No" automatically populated or not, but if you do, what's the logic to have it say Yes or No?
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    12-20-2019
    Location
    Houston
    MS-Off Ver
    Office 2010
    Posts
    8

    Re: Need help with Vlookup or a formula that fills out a cell automatically depending on i

    Thanks, I tried that formula and nothing populated in the cell.

    Basically I need to enter some times and if we take extra time from the allotted time, I need to put a code explaining why, so instead of copying and paste the code from sheet 2 I want it to autocomplete every time I add the code on sheet1, then if its a controllable reason it'll have to say YES and color code it in red so I know if it was the employees fault or NO in green if it wasn't.

    make sense?

  7. #7
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    2,831

    Re: Need help with Vlookup or a formula that fills out a cell automatically depending on i

    What do you mean nothing populated in the cell. Did you open the worksheet I attached? It's already populated with an example. I typed in 1100 in cell K2 and in L2, "LAE*‐*tires" shows up.

    What's a "controllable reason"? I color coded column M so it it says NO, it will be red, and if it says "Yes" it will be green. As I stated before, I don't if you are looking for the "Yes" and "no" to auopopulate and if you do, what's the logic?

+ 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. [HELP] Make a more complex VLOOKUP formula
    By lababa in forum Excel General
    Replies: 40
    Last Post: 03-06-2019, 03:53 AM
  2. [SOLVED] Complex Vlookup Formula
    By douggie in forum Excel General
    Replies: 6
    Last Post: 08-30-2016, 07:04 PM
  3. [SOLVED] Complex Vlookup formula on 2 columns
    By Air^Canada in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-14-2015, 08:47 AM
  4. [Solved] VBA Vlookup and complex Formula problem
    By Bansheete in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-03-2013, 08:23 AM
  5. Complex Vlookup formula
    By superdonk in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-16-2013, 11:58 AM
  6. Complex vlookup formula question
    By dta1984 in forum Excel General
    Replies: 54
    Last Post: 11-18-2011, 12:23 AM
  7. Help with complex formula - H and VLOOKUP
    By supraruss in forum Excel General
    Replies: 8
    Last Post: 07-01-2008, 12:04 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