+ Reply to Thread
Results 1 to 11 of 11

IF statement wont work correctly

  1. #1
    Registered User
    Join Date
    11-03-2011
    Location
    Tamworth, England
    MS-Off Ver
    Excel 2007
    Posts
    12

    IF statement wont work correctly

    Hello, im trying to get this IF statement to work correctly:

    Please Login or Register  to view this content.
    The aim is to display only calculations for tarrif B in tarrif B call charges, but when i drag the formula down it will calculate it for tarrif A and C. (This should make more sense in the attachment)

    Hope someone can help me, thanks
    Attached Files Attached Files
    Last edited by dannyshezo; 11-04-2011 at 02:42 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    11-15-2007
    Location
    England
    MS-Off Ver
    Office Pro Plus 2021
    Posts
    424

    Re: IF statement wont work correctly

    How about -

    =IF(RIGHT(G6,1)="B",IF(AND(C7=$A$3,D7<$C$3),0,D7*$E$2),"")

  3. #3
    Valued Forum Contributor
    Join Date
    10-13-2010
    Location
    Sunderland, England
    MS-Off Ver
    Excel 2007 (Home) / 2003 (Work)
    Posts
    740

    Re: IF statement wont work correctly

    You have the true and false parts of the statement the wrong way around.

    Try:

    =IF(AND(C7=$A$3,D7<$C$3),D7*$E$2,0)

  4. #4
    Valued Forum Contributor
    Join Date
    10-13-2010
    Location
    Sunderland, England
    MS-Off Ver
    Excel 2007 (Home) / 2003 (Work)
    Posts
    740

    Re: IF statement wont work correctly

    Having looked at the problem properly,

    =IF(AND($C10=$A$3,$D10>$C$3),($D10-$C3)*$E$3,0)

    would work much better!

  5. #5
    Registered User
    Join Date
    11-03-2011
    Location
    Tamworth, England
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: IF statement wont work correctly

    Will give that go thanks

  6. #6
    Registered User
    Join Date
    11-03-2011
    Location
    Tamworth, England
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: IF statement wont work correctly

    Quote Originally Posted by timbo1957 View Post
    How about -

    =IF(RIGHT(G6,1)="B",IF(AND(C7=$A$3,D7<$C$3),0,D7*$E$2),"")
    The problem with this is that when i drop and drag it for the rest it wont actually display anything for any other

  7. #7
    Registered User
    Join Date
    11-03-2011
    Location
    Tamworth, England
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: IF statement wont work correctly

    Quote Originally Posted by brokenbiscuits View Post
    Having looked at the problem properly,

    =IF(AND($C10=$A$3,$D10>$C$3),($D10-$C3)*$E$3,0)

    would work much better!
    For some reason this one is calculating for tarrif A and C still but displays everything as 0
    Last edited by dannyshezo; 11-04-2011 at 12:43 PM.

  8. #8
    Valued Forum Contributor
    Join Date
    10-13-2010
    Location
    Sunderland, England
    MS-Off Ver
    Excel 2007 (Home) / 2003 (Work)
    Posts
    740

    Re: IF statement wont work correctly

    Sorry, missed off a $

    Cell G7:
    =IF(AND($C7=$A$3,$D7>$C$3),($D7-$C$3)*$E$3,0)

    Change the 3s to 2s for A and 4s for C

  9. #9
    Registered User
    Join Date
    11-03-2011
    Location
    Tamworth, England
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: IF statement wont work correctly

    Its now displaying the costs for B but still displays 0 for all the rest, i should of said, i need it to display nothing if its in tarrif A and C under call charges B

    Ive uploaded what it looks like now
    Attached Files Attached Files

  10. #10
    Valued Forum Contributor
    Join Date
    10-13-2010
    Location
    Sunderland, England
    MS-Off Ver
    Excel 2007 (Home) / 2003 (Work)
    Posts
    740

    Re: IF statement wont work correctly

    Ok, last chance 'cause I'm off home:

    =IF($C7<>$A$3,"",IF($D7>$C$3,($D7-$C$3)*$E$3,0))

    ?

  11. #11
    Registered User
    Join Date
    11-03-2011
    Location
    Tamworth, England
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: IF statement wont work correctly

    Thank you it works

+ 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