Logic question IF cell is 0 . . .

Kerri78

New Member
Joined
Jan 30, 2024
Messages
4
Office Version
  1. 365
Platform
  1. Windows
Hi there, needing some help with logic if you can...
I want to add two cells, and give a different answer if the result is 0
eg:
(A2+A3) IF (A2+A3=0) then use the value in A1, otherwise use the answer (A2+A3)
Is someone able to help me formulate this please?
Thanks
🙂
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Welcome to the MrExcel forum!

Try:

Excel Formula:
=IF(A2+A3=0,A1,A2+A3)
 
Upvote 1
Solution
Welcome to the MrExcel forum!

Try:

Excel Formula:
=IF(A2+A3=0,A1,A2+A3)
Eric, one last thing, if I wanted the same formula but with the IF code to be <0, is there a way to do that?
Apparently just putting <0 doesn't work!
 
Upvote 0
Eric, one last thing, if I wanted the same formula but with the IF code to be <0, is there a way to do that?
Apparently just putting <0 doesn't work!
Nevermind, if I accept the Excel suggestion, it works IF(A2+A3<=0,A1,A2+A3)
... which seems really odd, but there you go!
 
Upvote 0
Hard to say without seeing your data, but it might be rounding issues, which crop up fairly often in Excel. In any case, it looks like you got something that works for you. Good luck!
 
Upvote 0

Forum statistics

Threads
1,215,603
Messages
6,125,771
Members
449,259
Latest member
rehanahmadawan

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