View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
joel joel is offline
external usenet poster
 
Posts: 9,101
Default How to do calculations with Null in the column?

Use one of the is functions along with an IF function

=if(isna(B2),,B2+B4)



ISBLANK(value)
ISERR(value)
ISERROR(value)
ISLOGICAL(value)
ISNA(value)
ISNONTEXT(value)
ISNUMBER(value)
ISREF(value)
ISTEXT(value)



"Yuanhang" wrote:

As showed in the example:

Row No. A B C Calculations
1 5 #N/A #N/A
2 10 3 20------------(A4-A2)
3 20 #N/A #N/A
4 30 6 25------------(A7-A2)/2
5 40 #N/A #N/A
6 50 #N/A #N/A
7 60 8 25-----------(A9-A4)/2
8 70 #N/A
9 80 14 20-----------(A9-A7)
10 90 #N/A
11 100 #N/A


Whether we do the calculations depends on the status of cells in the column
B. If the cell in the column B is denoted as #N/A, there's no calculation at
all. If the value in column B is a number, then we do some calculations with
cells in the column A and display the results in the column C.
The way to calculate is half the distance between cells in column A on
either side. But on upper or lower edge, it's simply the difference between
the edge cell and its adjacent cell. It's too difficult to explain this.
Please see the calculations above.

Thanks for the patience. Please help me solve this problem.