Calculate only if cell is not empty

Harrij

New Member
Joined
Nov 3, 2009
Messages
10
Office Version
  1. 2021
Platform
  1. MacOS
Pfff tried all but I do fail at this simple question. Ik just want to calculate two cells and only want the result if the ONE cell is <>0.
I want to have a result in G8 only if a value in column F <> 0. As you can see I now end up with a result in G9 which I do not want to see.
The calculation is just basic maths example: G8 result cell |. =Sum(F8-E8) and result -345 thats ok and fine. Now I want to have the next calculation
to NOT calculate (or leave result cell empty ) when in this example cell F9 = 0

I guess I need something like =IF(F9<>0,"",F9-E9). where F9 needs to become any cell in column F containing a 0 value.
But this keeps giving an error in the formula..... whose got more brains than me....??? Its all basic but I can't figure it out...



test.xlsx
H
13
Sheet1
 

Attachments

  • CleanShot 2022-08-06 at 22.08.32@2x.png
    CleanShot 2022-08-06 at 22.08.32@2x.png
    80.2 KB · Views: 14
You need to modify the formula if you paste it in the G row, you're just counting the same thing over again otherwise in all the columns... H should be G-F and so on...
 
Upvote 0
Solution

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
1. What exactly is the error?

2. If you
- take a blank worksheet,
- click this icon
1659961610546.png
at the top left of my mini sheet in post #7,
- select cell E6 in the blank worksheet and
- Paste
What happens?
 
Upvote 0
1. What exactly is the error?

2. If you
- take a blank worksheet,
- click this icon View attachment 71086 at the top left of my mini sheet in post #7,
- select cell E6 in the blank worksheet and
- Paste
What happens?
Pfff after 2 days I finally found WHY on a Mac it works different: Original formula. =IF(F8=0,0,F8-E8) but on a iMac =IF(F8=0;0;F8-E8). !!!!!!!

Now all work....my god......
 
Upvote 0
Original formula. =IF(F8=0,0,F8-E8) but on a iMac =IF(F8=0;0;F8-E8)
That is not because you are on a Mac, it is related to your regional settings. Given that you had used a comma separator in post 1 ..
I guess I need something like =IF(F9<>0,"",F9-E9)
.. the separator issue did not enter my mind. :)

Anyway, the main thing is that it is now resolved. (y)
 
Upvote 0

Forum statistics

Threads
1,214,839
Messages
6,121,887
Members
449,057
Latest member
Moo4247

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top