+ Reply to Thread
Results 1 to 9 of 9

Simple IF variable, but cant seem to figure out how

Hybrid View

  1. #1
    Registered User
    Join Date
    11-24-2009
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    11

    Simple IF variable, but cant seem to figure out how

    Hello,
    I have a 3 lists, one for the data values, whereas other raw data.

    Data values-
    A1,A2,A3, - (structure)
    Red,34,10
    Blue,12,52
    Green,15,72
    Yellow,12,162


    Raw Data,
    A1,A2,A3
    Red
    Red
    Red
    Red
    Blue
    Red
    Green
    Yellow
    Yellow
    Red

    Now i want that if cell has "red" in it, then A2 is inserted 34, wheres A3, 10.
    I have about 12K entries, and about 300 colors in data values, so pls help as doing it manually... will not be feasible.

    I am familiar with running macros, and also with = functions. Any help will be greatly appreciated, Thanks.

  2. #2
    Forum Expert ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2010
    Posts
    2,952

    Re: Simple IF variable, but cant seem to figure out how

    Hi ginjack,

    Seems like all you need to do is use a VLOOKUP function.

    Cheers,
    Would you like to say thanks? Please click the: " Add Reputation" button, on the grey bar below the post.

  3. #3
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,375

    Re: Simple IF variable, but cant seem to figure out how

    maybe with a vlookup ...

    if your table with the data values lives in A1 to C5, and your raw data starts in A7 you could use

    in B7 =VLOOKUP(A7,$A$1:$C$5,2,FALSE)

    in C7 =VLOOKUP(A7,$A$1:$C$5,3,FALSE)

  4. #4
    Registered User
    Join Date
    11-23-2009
    Location
    Porto, Portugal
    MS-Off Ver
    Excel 2007
    Posts
    32

    Re: Simple IF variable, but cant seem to figure out how

    Equal to teylin suggestion. Here is a file with an example:
    Attached Files Attached Files
    Last edited by lopiner; 11-24-2009 at 08:29 PM.

  5. #5
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,375

    Re: Simple IF variable, but cant seem to figure out how

    lopiner, could you please use the forum's file attachment functionality instead of external storage sites? People are a bit wary of those and don't like to get hammered with ads.

  6. #6
    Registered User
    Join Date
    11-23-2009
    Location
    Porto, Portugal
    MS-Off Ver
    Excel 2007
    Posts
    32

    Re: Simple IF variable, but cant seem to figure out how

    teylyn,
    I'm sorry, I'm new to the forum and didn't realise that there was such functionally. Will use it in the future. Thanks for the notice.

  7. #7
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,526

    Re: Simple IF variable, but cant seem to figure out how

    Not knowing what the structure of you workbook looks like, here is a simple example.
    Look at Sheet2 for the data for each color would be.

    Yay!, This has become my 4,000th post.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    11-24-2009
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Simple IF variable, but cant seem to figure out how

    Thanks for the promt response, and lopiner thanks for uploading the file. It was great help.
    Unfortunately, After doing abt 444 entries, it starts to give me a error of #N/A for both row 2 and 3 ?
    any ideas why thats going on? I have checked so caps is similar, spelling is similar. I copy pasted the 445th entry to replace the db, but still no luck. Whereas when i replaced the 445th entry with one of the earlier colors, it worked.
    Any ideas why this is going on?
    Last edited by ginjack; 11-24-2009 at 08:52 PM.

  9. #9
    Registered User
    Join Date
    11-24-2009
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Simple IF variable, but cant seem to figure out how

    Problem Solved -
    I forgot to change the C4 box. the function was only picking till C4 data bank, so A5, was not being picked at all with it. I cant believe i missed that earlier.

    =VLOOKUP(A348,$A$1:$C$345,2,FALSE)
    this worked for me since i have 345 rows of colors

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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