ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   calculating a value if adjacent cell has value (https://www.excelbanter.com/excel-worksheet-functions/218948-calculating-value-if-adjacent-cell-has-value.html)

Matt Stayton[_2_]

calculating a value if adjacent cell has value
 
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!



JE McGimpsey

calculating a value if adjacent cell has value
 
One way:

A3: =IF(B30, B2+1,"")

In article ,
Matt Stayton wrote:

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!


Matt Stayton[_2_]

calculating a value if adjacent cell has value
 
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!


"JE McGimpsey" wrote:

One way:

A3: =IF(B30, B2+1,"")

In article ,
Matt Stayton wrote:

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!



JE McGimpsey

calculating a value if adjacent cell has value
 
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.


In article ,
Matt Stayton wrote:

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!


"JE McGimpsey" wrote:

One way:

A3: =IF(B30, B2+1,"")

In article ,
Matt Stayton wrote:

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!




All times are GMT +1. The time now is 05:15 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com