Calculating a value but omitting cells with empty data

A

Andrew Chalk

I want to calculate a value based on several cells in say row 4. However, I
do not want to include values in any columns that do not also have a
non-missing value in, say, row3. Thus my calculated cell in, say column A,
should have some syntax like:

IF A3 <> MISSING THEN
< do calculation of value>

I hope this is clear.

What is the proper syntax for the pseudocode that I have above?

Thanks!
 
L

Luke M

Depends on what your calculation is. Are you summing, counting, multiply,
etc.?Each has their own formula structure.

For instance, the basic summing one is
=SUMIF(3:3,"<>"&"",4:4)
Sums every value in row 4 that doesn't have a corresponding blank cell in
row 3.
Similary, counting is
=COUNTIF(3:3,"<>"&"",4:4)

You could also look at other ways of using IF functions to limit data sets.
 
L

Luke M

Depends on what your calculation is. Are you summing, counting, multiply,
etc.?Each has their own formula structure.

For instance, the basic summing one is
=SUMIF(3:3,"<>"&"",4:4)
Sums every value in row 4 that doesn't have a corresponding blank cell in
row 3.
Similary, counting is
=COUNTIF(3:3,"<>"&"",4:4)

You could also look at other ways of using IF functions to limit data sets.
 
A

Andrew Chalk

It is actually a cell calculation. An example is:

=(G13-G12)/G12

If G12 is not zero I want the above calculation to be done.

If it is zero I want to not do the above calculation, but the value zero to
be used instead

Thanks.
 
A

Andrew Chalk

It is actually a cell calculation. An example is:

=(G13-G12)/G12

If G12 is not zero I want the above calculation to be done.

If it is zero I want to not do the above calculation, but the value zero to
be used instead

Thanks.
 
H

Harlan Grove

Andrew Chalk said:
It is actually a cell calculation. An example is:

=(G13-G12)/G12

If G12 is not zero I want the above calculation to be done.

If it is zero I want to not do the above calculation, but the value zero to
be used instead
....

=IF(COUNT(1/G12),G13/G12-1,0)
 
H

Harlan Grove

Andrew Chalk said:
It is actually a cell calculation. An example is:

=(G13-G12)/G12

If G12 is not zero I want the above calculation to be done.

If it is zero I want to not do the above calculation, but the value zero to
be used instead
....

=IF(COUNT(1/G12),G13/G12-1,0)
 

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