Hey Everyone,
I need a formula for this:
B2-B1 answer in C2 but it will not display a negative number.![]()
Hey Everyone,
I need a formula for this:
B2-B1 answer in C2 but it will not display a negative number.![]()
Try
=MAX(0,B2-B1)
So far so good.
But, if I enter data in say B2 but have not in B1 yet, how do I stop C2 from displaying what I entered in B2?
So far so good.
But, if I enter data in say B2 but have not in B1 yet, how do I stop C2 from displaying what I entered in B2?
=if(and(b2="",B1=""),"",B2-B1)
1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
2. If your question is resolved, mark it SOLVED using the thread tools
3. Click on the star if you think someone helped you
Regards
Ford
May be:
=IF(OR(B1="",B2=""),"",MAX(0,B2-B1))
Quang PT
Thanks bebo,
How do I get it to display a 0?
Here is an example of my current problem:
Cell C3 should display a 0 instead of the 76,575,490. At the bottom of the table I have it total, but it currently totals all the cells, which gives me incorrect data.
B C
1 0 0
2 0 0
3 76575490 76,575,490
4 77333314 757,824
5 78164163 830,849
6 TOTAL 78,164,163
I think this has somehow gone out into left field and is way more complicated than it should be.
This was given
You responded
I would think that meant it worked, except that it returned a "" when you wanted a 0
So I would just change
=IF(OR(B1="",B2=""),"",MAX(0,B2-B1))
to
=IF(OR(B1="",B2=""),0,MAX(0,B2-B1))
Thanks Jonmo1
That worked perfectly.
I really appreciate everyone's help.![]()
OK do you mean you dont WANT it to show a negative answer, or that it just will not show a negative number?
If you want it to NOT show a neg number, then use this...
=if(b2-B1>0,"",B2-B1) (you can change "" for 0 if you want)
If you want it to show a positive number (not a negative number) no matter what the answer is, then use this...
=abs(B2-B1) this will show 3-1 as 2 and 1-3 as 2 (not -2)
if you currently have 76,575,490 in C3, but it should read 0 instead, why not just type on 0?
Would be simple, but its a monthly spreadsheet to track data and in my example if I have a 0 above a cell, it just carries the last number inputted. Which gives me incorrect data. I'd like it to not give me a total if the previous cell has no entry. if that makes sense.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks