+ Reply to Thread
Results 1 to 7 of 7

Excel 2007 : Compare text returned as result of formula in A1 with text typed in B1 to see if match

  1. #1
    Registered User
    Join Date
    06-08-2012
    Location
    Cincinnati, OH
    MS-Off Ver
    Excel 2007
    Posts
    3

    Compare text returned as result of formula in A1 with text typed in B1 to see if match

    In column A I have several contiguous rows with similar formulas in the cells that return various text strings as the result of the formulas. In column B I have typed in a list of the text strings I expect to appear in column A as a result of the formulas in Column A. I would like to flag any discrepancies that may exist, preferably by conditional formatting that would highlight in red any cell in column A that does not match its corresponding (same row) cell in column B. The formulas I have tried to use to make the comparison will not recognize the text value RESULTS of the formulas in column A to compare with column B. The formulas all want to compare the text of the FORMULAS in column A with the text in column B, which, of course, will not match. How do I get a cell reference in a formula to read the text result of the formula in the cell being referenced instead of reading the text of the formula itself?

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

    Re: Compare text returned as result of formula in A1 with text typed in B1 to see if match

    Sample workbook maybe ...
    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


  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Compare text returned as result of formula in A1 with text typed in B1 to see if match

    How do I get a cell reference in a formula to read the text result of the formula in the cell being referenced instead of reading the text of the formula itself?
    Excel formulas ALWAYS look at the values of cells, not the formulas (if any) that produce them.
    Entia non sunt multiplicanda sine necessitate

  4. #4
    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: Compare text returned as result of formula in A1 with text typed in B1 to see if match

    perhaps you could (temporarily if necessary?) convert the formulas to text for the comparison? you could use find/replace find = replace '= ? you could then even copy thodse "text'd" formulas to a new column, change the originals back and do the comparison from the "new" data?
    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

  5. #5
    Registered User
    Join Date
    06-08-2012
    Location
    Cincinnati, OH
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Compare text returned as result of formula in A1 with text typed in B1 to see if match

    If I type the same word in A1, B1, and B2, and enter the formula =A1 in A2, I find that =EXACT(A1,B1) and =EXACT(A2,B2) both return TRUE. So it would appear that shg's observation is also TRUE. Except when I try using EXACT when the word in A2 is a text string returned from using HLOOKUP, and I type the same string in B2, =EXACT(A2,B2) returns FALSE. Why is this different?

  6. #6
    Registered User
    Join Date
    06-08-2012
    Location
    Cincinnati, OH
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Compare text returned as result of formula in A1 with text typed in B1 to see if match

    I found my problem. The text string returned from the HLOOKUP formula (in cell A2) had a space after the string. I had not typed in that extra space in cell B2. When I did, I got a match. That extra space was invisible, so I missed it. Sorry to have bothered you.

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

    Re: Compare text returned as result of formula in A1 with text typed in B1 to see if match

    Thanks for the rep. A sample workbook would probably have got you an answer much quicker.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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