+ Reply to Thread
Results 1 to 10 of 10

problem with IF cell contains "text" from resulting formula

  1. #1
    Forum Contributor
    Join Date
    09-12-2013
    Location
    chicago, illinois
    MS-Off Ver
    Excel 2010
    Posts
    109

    problem with IF cell contains "text" from resulting formula

    ok, so i can NOT figure this out at all. I have a vlookup in cell C3 that returns the value "BLUE" based off of the value of cell A3. in D3, i have the formula: =IF(C3="BLUE","MARY","") but i am getting a blank cell...excel is not seeing the value MARY in the cell i think. is there another way to get this value? what am i doing wrong?

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: problem with IF cell contains "text" from resulting formula

    are you saying c3 has BLUE in it and this formula returns blank?
    =IF(C3="BLUE","MARY","") if so c3 doesn't contain just "BLUE" it may have spaces before or after it or other invisible non printing characters
    what does =len(c3) return if it is not 4 then there is something else in the cell
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,463

    Re: problem with IF cell contains "text" from resulting formula

    Suggest you post a sample workbook. Doesn't look anything wrong with the formula.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Forum Contributor
    Join Date
    09-12-2013
    Location
    chicago, illinois
    MS-Off Ver
    Excel 2010
    Posts
    109

    Re: problem with IF cell contains "text" from resulting formula

    C3 has the vlookup formula in it. there is a large table it grabs data from...so the cell C3 actually has this in it: =vlookup(A2,mainrng,3,false) in this case, it returns BLUE... my problem is in D3. i'm trying to use the formula: =IF(C3="BLUE","MARY","") . the formula SHOULD return "MARY" since the cell C3 says blue, based off the vlookup. however it returns a blank. i think excel is looking at the value of C3 as the vlookup formula and not the result of the vlookup. i can not figure out how to base the if statement off of the vlookup formula result.

  5. #5
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: problem with IF cell contains "text" from resulting formula

    read post #2

  6. #6
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: problem with IF cell contains "text" from resulting formula

    Quote Originally Posted by fredderf81 View Post
    i think excel is looking at the value of C3 as the vlookup formula and not the result of the vlookup.
    No, the formula in D3 looks at the result of the vlookup formula in C3.

    What Martin is trying to say is that the Vlookup formula is not returning EXACTLY "BLUE".
    It may be returning " BLUE" or "BLUE "
    With an extra space or somethign.

    What does =LEN(C3) return?

    Posting a sample book would be most helpful.

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,463

    Re: problem with IF cell contains "text" from resulting formula

    Jonmo1:
    Posting a sample book would be most helpful.
    I said that

  8. #8
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: problem with IF cell contains "text" from resulting formula

    Quote Originally Posted by TMS View Post
    I said that
    Good job

  9. #9
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: problem with IF cell contains "text" from resulting formula

    i think it's time to post a workbook

  10. #10
    Forum Contributor
    Join Date
    09-12-2013
    Location
    chicago, illinois
    MS-Off Ver
    Excel 2010
    Posts
    109

    Re: problem with IF cell contains "text" from resulting formula

    AHH, it just took me reading the post over again =) .... as a bad habit, i had in the formula "*BLUE*" which did not return what i wanted. .... removed the 2 * and it works .


    thanks for setting me straight!!!

+ 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: 4
    Last Post: 11-17-2013, 12:05 PM
  2. Find "TEXT 1" in a range and enter "TEXT 2" in the adjacent cell
    By madreag in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-28-2013, 05:34 PM
  3. [SOLVED] If there is any text in column "A$" on "sheet1" then move cell to column "A$" on "sheet2"
    By ckgeary in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-27-2013, 08:28 PM
  4. Replies: 8
    Last Post: 09-06-2011, 02:54 PM
  5. Replies: 2
    Last Post: 08-02-2011, 06:57 AM

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