+ Reply to Thread
Results 1 to 5 of 5

Thread: code:IF statement

  1. #1
    Registered User
    Join Date
    03-05-2011
    Location
    Somerset, England
    MS-Off Ver
    Excel 2003
    Posts
    3

    code:IF statement

    Hi everyone,

    I want to use the IF statement - IF(logical_test, [value_if_true], [value_if_false]) - with a formula in 'the value if true' segment, is this possible? I can use it with a text result but can't get it to work with a formula. The formula would be to subtract one range from another and post the result if the logical test is true with a null if false.
    I really don't have enough hair left to keep trying on my own.
    Thanks

  2. #2
    Extremely Helpful member
    Join Date
    12-23-2006
    Location
    Belgium
    MS-Off Ver
    XL2003
    Posts
    6,127

    re: code:IF statement

    Hi and welcome to the board

    Could you please post the formula you have problems with and/or a small sample file of your data?
    Quoting entire posts clutters the forum and makes threads hard to read !

    If you are pleased with a member's answer then use the Star icon to rate it

    Click here to see forum rules

  3. #3
    Registered User
    Join Date
    03-05-2011
    Location
    Somerset, England
    MS-Off Ver
    Excel 2003
    Posts
    3

    re: code:IF statement

    Hi and thanks for the welcome! Sorry, I should have posted the formula; this is it -

    =SUM($E$2:E4)-(SUM($C$2:C4))

    It works fine by itself, I just want to wrap the IF statement around it.

  4. #4
    Forum Guru Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    2,782

    re: code:IF statement

    You haven't said what the logical test portion is but try this:

    =IF(logical test,SUM($E$2:E4)-SUM($C$2:C4),"")

  5. #5
    Registered User
    Join Date
    03-05-2011
    Location
    Somerset, England
    MS-Off Ver
    Excel 2003
    Posts
    3

    re: code:IF statement

    Hi Cutter,
    looks so simple now, I was confused with the square brackets and I may have missed a comma. Strange how I can see other people's errors but not my own.
    Thanks.

+ 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.2.0