If Then Else Not Returning Expected Result

  • I have the following formula in a cell, say A6, of a worksheet: =if(A5=A4,"Yes","NO !!!"). The data in A4 is the result of an autosum, and the data in A5 is a number value, simply typed in. Both A4 and A5 are formatted to Accounting, 2 decimal places. Even though the numerical result of the autosum in A4 is identical in value in A5, the value returned in A6 will only show "NO !!!". I have tried the formula in both another worksheet, and in another previously unused portion of the first worksheet, and it works fine. I have removed previously merged cell and other formats in the original cells, but to no avail. Any ideas (to save me having to redo the whole worksheet from scratch)?

  • Re: If Then Else Not Returning Expected Result


    Ae you sure that the cells are all formatted correctly? If A5 is formatted as Text then I don't think the formula will work

  • Re: If Then Else Not Returning Expected Result


    All cells formatted as Accounting, 2 dec., symbol Au$. Font colours not the same, but I tried with colours all the same and it didn't help. Triple checked it, but still not working. I have copied and pasted again to another 'fresh' part of the worksheet, and it works fine. (Only trouble is that that is not where I want the cells to appear.) Quite a mystery to me.

  • Re: If Then Else Not Returning Expected Result


    I looked on some of your site's Excel tips and help guidelines, and tried to follow the advices re staying away from merged cells, etc. but no luck yet.

  • Re: If Then Else Not Returning Expected Result


    Can you attach part of the workbook showing the error? I don't know what "autosum" is, but if there is any rounding involved, you may be getting the small floating-point arithmetic errors we keep hearing about. But that wouldn't work somewhere else in the workbook...

  • Re: If Then Else Not Returning Expected Result


    Can you explain to me how to attach a part of the workbook to a reply? I tried to do it with a simple copy and paste just now, but it doesn't show any formulas that I could see. Just text and data as if simly typed onto a page. I couldn't see how it would explain anything. Please excuse my lack of knowledge.

  • Re: If Then Else Not Returning Expected Result


    Quote from ByTheCringe2

    Can you attach part of the workbook showing the error? I don't know what "autosum" is, but if there is any rounding involved, you may be getting the small floating-point arithmetic errors we keep hearing about. But that wouldn't work somewhere else in the workbook...


    OK. I checked the help section of the site, and found how to attach a file. I think I have done it, but can't see it here. I'll post this anyway and see if it works. Else I'll try again.

  • Re: If Then Else Not Returning Expected Result


    I think the attachment didn't go last post because the file size was too big. I see that attachments must be only 46 kb or something. So I deleted half of my workbook, and half of the worksheet, but now the formula works. So there is no point in sending it now. I think I'll just file this under 'X-Files', and forget about it as quickly as possible. But thanks anyway. Unless you are curious enough about the problem for me to email you the problem workbook in its entirety (about 120kb).

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!