+ Reply to Thread
Results 1 to 7 of 7

IF(AND( Formula gives same answer all the time

  1. #1
    Registered User
    Join Date
    09-26-2014
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    4

    IF(AND( Formula gives same answer all the time

    Hey guys, I've currently got this formula and was wondering why it isn't working... It always comes up with "Continue", where it should come up as "Needs Attention".

    =IF(AND(MAX(D4:D6)-MEDIAN(D4:D6)=MEDIAN(D4:D6)-MIN(D4:D6), MAX(D4:D6)-MIN(D4:D6)<=0.2), "Needs Attention", "Continue")

    Where:
    D4 = 0.56
    D5 = 0.50
    D6 = 0.44

    From whatever troubleshooting I've done, it seems like the problem lies in logical1 of the AND statement.

    Cheers!

  2. #2
    Forum Expert boopathiraja's Avatar
    Join Date
    07-12-2013
    Location
    Coimbatore,TamilNadu, India
    MS-Off Ver
    Excel 2007, 2013, 2016, 365
    Posts
    1,455

    Re: IF(AND( Formula gives same answer all the time

    I don't get the logic but may be this

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Click just below left if it helps, Boo?ath?

  3. #3
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: IF(AND( Formula gives same answer all the time

    No Booşathì , this is (quite) common problem of double precission accuracy.
    Have a look on result of (make sure formatting is general):
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    it is not 0 but some very small number 5.55112E-17

    @Overheard: try this:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    and see http://support2.microsoft.com/kb/78113 for additional info.
    Last edited by Kaper; 09-26-2014 at 03:29 AM.
    Best Regards,

    Kaper

  4. #4
    Registered User
    Join Date
    09-26-2014
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    4

    Re: IF(AND( Formula gives same answer all the time

    Hey guys, thanks for the help but it's not quite what I'm after. This statement is a part of a much larger nest of if statements, and I'm trying to see if there difference between the max and median, and the median and min is equal. I also have to make sure that if that difference is equal, that it is less than 0.2.

    The statements that you both have given me are not seeing if they are equal, but rather taking one from the other. If you can think of anything else that may help that would be awesome!

    Cheers.

  5. #5
    Registered User
    Join Date
    09-25-2014
    Location
    PEI, Canada
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: IF(AND( Formula gives same answer all the time

    If they are taking one from the other, then isn't absolute value of that difference<=0.2 what you want?

  6. #6
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: IF(AND( Formula gives same answer all the time

    Quote Originally Posted by Overheard View Post
    The statements that you both have given me are not seeing if they are equal, but rather taking one from the other.
    Kaper's solution is checking whether the difference is small enough to ignore as rounding error, so isn't that perfectly substitutable with what you want?

  7. #7
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: IF(AND( Formula gives same answer all the time

    The normal solution is to use ROUND, e.g.

    =IF(AND(ROUND(MAX(D4:D6)-MEDIAN(D4:D6),9)=ROUND(MEDIAN(D4:D6)-MIN(D4:D6),9), MAX(D4:D6)-MIN(D4:D6)<=0.2), "Needs Attention", "Continue")

    rounding to 9 decimal places shouldn't lose you any accuracy if your figures really only have 2 decimal places
    Audere est facere

+ 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: 1
    Last Post: 11-21-2012, 02:03 AM
  2. Replies: 2
    Last Post: 01-29-2012, 07:08 AM
  3. final answer to run macro at certain time
    By as_sass in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-18-2005, 01:05 AM
  4. [SOLVED] i edit a formula (excel) then it displays formula not answer
    By caiman in forum Excel General
    Replies: 2
    Last Post: 09-08-2005, 10:05 PM
  5. Replies: 3
    Last Post: 04-21-2005, 09:07 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