If statement

Baseball15

New Member
Joined
Nov 13, 2018
Messages
3
Sorry this seems simple but not working for me.
I want to compare to see if c4 > n4.
If c4 > n4 subtract n4 from c4 else put a zero in the cell

This isn't working for me.
c4 currently equal to 35,844
n4 currently equal to 24,852
P4 should be 10992 but it puts a dash in the cell.

Here is what I entered in P4.
=IF (c4>n4,c4-n4,0)

Thanks in advance for your assistance.
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Welcome to the Board!

I am assuming that you do not really have a space between the word IF and the left parenthesis.

Are both of your entries numbers, or "numbers added as text"?
An easy way to tell is the to enter the following formulas somewhere:
=ISNUMBER(C4)
=ISNUMBER(P4)


If either returns FALSE, then you do not have a valid number entry in that cell.

BTW, another way to do what you want is like this:
Code:
=MAX(C4-P4,0)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

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