+ Reply to Thread
Results 1 to 4 of 4

Formula That Calculates Conditionally

  1. #1
    Registered User
    Join Date
    04-17-2013
    Location
    Houston, TX
    MS-Off Ver
    Excel 2003
    Posts
    43

    Formula That Calculates Conditionally

    Hello,

    I am trying to come up with a formula that calculates only when there are values in both cells. For example, I am subtracting $C4 from $B4, where column B is the month of May and column C is the month of June. I do not want this subtraction to take place until I have entered values in column C for the month of June.

    Does anyone have any ideas for how I can write a condition like that into a formula?

    Thank you!

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,604

    Re: Formula That Calculates Conditionally

    Try this:

    =IF(OR(C4="",B4=""),"",C4-B4)

    Shows a blank if either of the two cells are empty.

    Hope this helps.

    Pete

  3. #3
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Formula That Calculates Conditionally

    Maybe something like this...

    =IF(COUNT($B4:$C4)<2,"",$B4-$C4)
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    Registered User
    Join Date
    04-17-2013
    Location
    Houston, TX
    MS-Off Ver
    Excel 2003
    Posts
    43

    Re: Formula That Calculates Conditionally

    Pete that seems to be working beautifully! Thank you both very much for you help! It is greatly appreciated.

+ 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