+ Reply to Thread
Results 1 to 4 of 4

Simple IF problem

  1. #1
    Registered User
    Join Date
    02-20-2007
    Posts
    50

    Simple IF problem

    I have following expression but giving me wrong output.Pls help me to solve it

    =IF(E8="BA1",(T8/1.125)-((T8/1.125-164.8)/1.103))-260,(T8/1.125)-((T8/1.125-164.8)/1.103)

    where T8=5220 AND E8="BA1"

    and result should be =322.70
    but it is giving me wrong output by making my expession like as follows

    =IF(E8="BA1",(T8/1.125)-((T8/1.125-164.8)/1.103))-260*(T8/1.125)-((T8/1.125-164.8)/1.103)

    pls help me to solve and also teach or explain me why it is converting like this ..
    Thanks in advance

  2. #2
    Forum Expert Colin Legg's Avatar
    Join Date
    03-30-2008
    Location
    UK
    MS-Off Ver
    2003, 2007, 2010, 2013
    Posts
    1,252

    Re: Simple IF problem

    Hi,

    Your original formula is invalid because you have one too many ) brackets in the middle and you are missing one at the end, so Excel tries its best to interpret what the formula should be. Obviously Excel's interpretation is wrong - but it does give you a prompt to let you know that it made a guess (it gives you the option to amend it yourself).

    Your current formula is:
    =IF(E8="BA1",(T8/1.125)-((T8/1.125-164.8)/1.103))-260,(T8/1.125)-((T8/1.125-164.8)/1.103)

    It should be this:
    =IF(E8="BA1",(T8/1.125)-((T8/1.125-164.8)/1.103)-260,(T8/1.125)-((T8/1.125-164.8)/1.103))

    Which can be simplified to:
    =(T8/1.125)-((T8/1.125-164.8)/1.103)-IF(E8="BA1",260)
    Hope that helps,

    Colin

    RAD Excel Blog

  3. #3
    Registered User
    Join Date
    02-20-2007
    Posts
    50

    Re: Simple IF problem

    Quote Originally Posted by Colin Legg View Post
    Hi,

    Your original formula is invalid because you have one too many ) brackets in the middle and you are missing one at the end, so Excel tries its best to interpret what the formula should be. Obviously Excel's interpretation is wrong - but it does give you a prompt to let you know that it made a guess (it gives you the option to amend it yourself).

    Your current formula is:
    =IF(E8="BA1",(T8/1.125)-((T8/1.125-164.8)/1.103))-260,(T8/1.125)-((T8/1.125-164.8)/1.103)

    It should be this:
    =IF(E8="BA1",(T8/1.125)-((T8/1.125-164.8)/1.103)-260,(T8/1.125)-((T8/1.125-164.8)/1.103))

    Which can be simplified to:
    =(T8/1.125)-((T8/1.125-164.8)/1.103)-IF(E8="BA1",260)
    Thanks for reply
    I tried something like this but again same error

    =IF(P10="BA1",(N11/1.125)-H11-G11-E11-((N11/1.125)-((N11/1.125-164.8)/1.103)))-260,(N11/1.125)-H11-G11-E11-((N11/1.125)-((N11/1.125-164.8)/1.103))

    now there all brackets are equal pls tell me where is mistake

    thanks in advance

  4. #4
    Valued Forum Contributor ffffloyd's Avatar
    Join Date
    05-20-2008
    Location
    Melbourne, VIC, Australia
    MS-Off Ver
    Office 365
    Posts
    243

    Re: Simple IF problem

    It can be tricky counting all those brackets, so try copying the line into a text editor and manually add line feeds and nested indentation to get a clearer picture of what's there. With your statement, this is what I get:

    Please Login or Register  to view this content.
    It looks like you're still closing the IF off too early. That bracket on the left hand margin before the -260 needs to come out of there and go on the end.

+ 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