calculating a value if adjacent cell has value

M

Matt Stayton

I am trying to get a cell to perform a certain calculation if another cell
has a value placed in it larger than "0".

Column A Column B Column C
Row 1 Start End Total
Row 2 0 18 18
Row 3

I want cell A3 to calculate B2+1 only if B3 has a value larger than 0.
Otherwise I want the A3 to remain blank if nothing is entered in B3.

Thanks!
 
M

Matt Stayton

That worked perfectly, but now my total in column C reads #VALUE!.

In Column C I am having it subtract Column A from Column B example =B4-A4.

Then I also have a total at the bottom C8 with the formula =SUM(C2:C7). This
also gives me the answer #VALUE!

Column A Column B Column C
Row 1 Start End Total
Row 2 0 18 18
Row 3 19 198 179
Row 4 #VALUE!
Row 5 #VALUE!
Row 6 #VALUE!
Row 7 #VALUE!
Row 8 TOTAL #VALUE!

Thanks for your help!
 
J

JE McGimpsey

Math operators (+, -, *, /, etc) will return the #VALUE! error if one of
the arguments is text (including the null string, "")

One option:

C2: =IF(COUNT(A2:B2)=2,B2-A2,"")

The #VALUE! returned in C8 is due the the #VALUE! errors in C2:C7. SUM()
ignores text.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top