+ Reply to Thread
Results 1 to 4 of 4

Comparing Data showing "Wrong" results.

Hybrid View

  1. #1
    Registered User
    Join Date
    10-04-2012
    Location
    Not here, it's rubbish!
    MS-Off Ver
    Excel 2003/2007/2010
    Posts
    66

    Comparing Data showing "Wrong" results.

    Hi Everyone,

    I have a weird problem in Excel that has stumped me now for 3 days! The attached file replicates the problem in a larger project I'm working on so hopefully illustrates this. So this is the scenario.

    We have two lists going down column A showing years and months. Cell F8 basically uses a VLOOKUP on cells C2 and C17 to combine the two results into an output on F8.
    If you then use a formula to extract the first and last words from F8 you get the results in F10 and F11 respectfully. Likewise I’ve used VLOOKUP to display the Month and Year in cells F13 and F14 respectfully.
    Here’s the weird bit (weird to me). If I use an IF statement to compare if F10 and F13 are the same I get TRUE. However, if I use an IF statement to compare F11 and F14 I get FALSE!

    I thought this might have something to do with formatting numbers/text in the cells but in the example file, the whole sheet has a General formatting applied.

    Any ideas as to what is going on?

    Many thanks in advance.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,076

    Re: Comparing Data showing "Wrong" results.

    F11 is text F14 is a number
    hence the left and right justification

    =CELL("type",F11) produces "l" - text
    =CELL("type",F14) produces "v" - value

    in F11
    =RIGHT(F8,LEN(F8)-FIND("*",SUBSTITUTE(F8," ","*",LEN(F8)-LEN(SUBSTITUTE(F8," ","")))))*1

    cures this problem and satisfies your condition in F18
    Note the *1 at the end forcing the result to a number
    Last edited by Special-K; 05-08-2014 at 01:06 PM.
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Registered User
    Join Date
    10-04-2012
    Location
    Not here, it's rubbish!
    MS-Off Ver
    Excel 2003/2007/2010
    Posts
    66

    Re: Comparing Data showing "Wrong" results.

    Thank you Special-K!

    Works perfectly. Much appreciate your help.

  4. #4
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Comparing Data showing "Wrong" results.

    Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED". I will do it for you this time.

    In future, to mark your thread as Solved, you can do the following -
    Select Thread Tools-> Mark thread as Solved.

    Incase your issue is not solved, you can undo it as follows -
    Select Thread Tools-> Mark thread as Unsolved.

    Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help you.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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. solution for the blank cell using the IF function
    By ragnaedge in forum Excel General
    Replies: 4
    Last Post: 08-23-2013, 11:03 AM
  2. Replies: 2
    Last Post: 11-01-2012, 04:35 PM
  3. Replies: 3
    Last Post: 08-28-2012, 10:49 AM
  4. [SOLVED] comparing data in column [sheet1] with data in column [sheet2] and execute "yes" or "no"
    By dragon_m0nsta in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-14-2012, 03:27 AM
  5. How to change "automax" to "autosum"? (probablyl wrong terminology)
    By nomail1983@hotmail.com in forum Excel General
    Replies: 4
    Last Post: 08-07-2006, 07:20 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