Ignore NA in a formula when I type it in a cell

T

Tyler Manhattan

=IF(F6>0,10,0)+IF(H6>=1,10,0)+IF(I6>=1,10,0)+IF(Q6>=0,10,0)+(K6*20)+(M6*20)+(O6*20)-SUM(R6+S6)

When I put a NA into cells K6, M6, O6, R6, S6, it won't calculate obviously
because NA is not a number. It gives me the error message. Is there some
way to bypass this when a cell has a NA?
 
B

Bob Phillips

=IF(F6>0,10,0)+IF(H6>=1,10,0)+IF(I6>=1,10,0)+IF(Q6>=0,10,0)
+IF(ISNUMBER(K6),K6,0)*20+IF(ISNUMBER(M6),M6,0)*20+IF(ISNUMBER(O6),O6,0)*20
-(IF(ISNUMBER(R6),R6,0)+IF(ISNUMBER(S6),S6,0))
 
J

Joerg Mochikun

Instead of K6*20 use something like SUM(K6)*20 or MIN(K6)*20. Looks silly
but this prevents the error message when K6 contains text like 'NA':

=IF(F6>0,10,0)+IF(H6>=1,10,0)+IF(I6>=1,10,0)+IF(Q6>=0,10,0)+(MIN(K6)*20)+(MIN(M6)*20)+(MIN(O6)*20)-SUM(MIN(R6)+MIN(S6))

Cheers,

Joerg Mochikun


Bob Phillips said:
=IF(F6>0,10,0)+IF(H6>=1,10,0)+IF(I6>=1,10,0)+IF(Q6>=0,10,0)
+IF(ISNUMBER(K6),K6,0)*20+IF(ISNUMBER(M6),M6,0)*20+IF(ISNUMBER(O6),O6,0)*20
-(IF(ISNUMBER(R6),R6,0)+IF(ISNUMBER(S6),S6,0))
 
J

Joerg Mochikun

Sorry, that was too fast. Better:
Instead of K6*20 use N(K6)*20.

The function N converts non-number values to numbers.

Joerg Mochikun

Joerg Mochikun said:
Instead of K6*20 use something like SUM(K6)*20 or MIN(K6)*20. Looks silly
but this prevents the error message when K6 contains text like 'NA':

=IF(F6>0,10,0)+IF(H6>=1,10,0)+IF(I6>=1,10,0)+IF(Q6>=0,10,0)+(MIN(K6)*20)+(MIN(M6)*20)+(MIN(O6)*20)-SUM(MIN(R6)+MIN(S6))

Cheers,

Joerg Mochikun
 

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