+ Reply to Thread
Results 1 to 5 of 5

Exact formula applied to same exact value gives different results

  1. #1
    Forum Contributor
    Join Date
    09-19-2010
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2007
    Posts
    140

    Exact formula applied to same exact value gives different results

    Hey all,

    Before I lose my head, I attached an excel spreadsheet where I apply the SAME formula to two different cells with the SAME content, yet it produces two different results. In cell A1, it produces unintended results. And in cell, A23, it produces intended results. Formulas look big because I am taking things out of context to address this situation but in reality this formula addresses multiple conditions. Nevertheless, the problem relates directly to why this formula is yielding two different results when applied to same value.

    Thanks for response.
    Attached Files Attached Files
    Last edited by johnmerlino; 11-12-2010 at 01:02 AM.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,704

    Re: Exact formula applied to same exact value gives different results: proof attached

    In cell c1 and c23, I put the following formula =len(a1) and =len(a23) respectively and the results were 25 and 24. So the cells in column A are not exactly the same. Not sure what it is that is causing this. Do the values in Column A come from another source. I did a =trim(A1) and then got the same results. Appears that there was probably a space at the end of that cell
    Last edited by alansidman; 11-12-2010 at 12:13 AM. Reason: =trim additional comment
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Contributor
    Join Date
    09-19-2010
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2007
    Posts
    140

    Re: Exact formula applied to same exact value gives different results: proof attached

    I'm not sure what you're seeing. I'm trying to get the value returned in cell 23 to be returned in cell 1. Where's the space?

  4. #4
    Forum Contributor
    Join Date
    09-19-2010
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2007
    Posts
    140

    Re: Exact formula applied to same exact value gives different results: proof attached

    I put the trim:

    =TRIM(IF(AND(ISERROR(FIND(",",A1)),ISERROR(FIND("&",A1))),A1,IF(FIND(",",A1&",")<FIND("&",A1&"&"),IF(AND((LEN(SUBSTITUTE(A1,"&","",3))-LEN(SUBSTITUTE(A1,"&","",2))),(LEN(SUBSTITUTE(A1,",","",3))-LEN(SUBSTITUTE(A1,",","",2)))),TRIM(MID(A1,FIND("&",A1,1)+1,FIND("&",A1,FIND("&",A1,1)+1)-FIND("&",A1,1)-1)),IF(ISNUMBER(FIND(",",A1,FIND(",",A1)+1)),TRIM(MID(A1,FIND("&",A1)+1,FIND("&",A1)-3)),IF(ISNUMBER(FIND("&",A1,FIND("&",A1)+1)),CONCATENATE(LEFT(A1,FIND(",",A1)-1),",",TRIM(MID(A1,FIND("&",A1,1)+1,FIND("&",A1,FIND("&",A1,1)+1)-FIND("&",A1,1)-1))),IF(ISNUMBER(FIND("&",A1)),SUBSTITUTE(A1,MID(A1,FIND(",",A1)+1,FIND(" &",A1)-FIND(",",A1)+2),""),A1)))),RIGHT(A1,LEN(A1)-SEARCH("@",SUBSTITUTE(A1," ","@",LEN(A1)-LEN(SUBSTITUTE(A1," ","")))))&","&LEFT(A1,FIND("&",A1&"&")-1))))

    And I get the bad value to display in both of them. How do I get the right value to display in both of them?

    Thanks for response.

  5. #5
    Forum Contributor
    Join Date
    09-19-2010
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2007
    Posts
    140

    Re: Exact formula applied to same exact value gives different results: proof attached

    Actually you're right. The data did have space and removing it fixed problem.

+ 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