# Simple IF statement question

L

#### Legacy 5596

##### Guest
Sometimes I just can't wrap my mind around a long IF/conditional formula, like this one:

=if(sum(m2:m19>0, "NE ", if(sum(n2:n19>0, "NW ", if(sum(o2 19>0, "SE ", if(sum(p2 19>0, "SW ", if(sum(q2:q19>0, "MW ", if(sum(r2:r19>0, "CAN ", if(sum(s2:s19>0, "MX", "")

Its obviously a problem with where to put the closing parens but the help doesn't really help :wink: if just says the problem is at the point I indicate with red bolded text.

help?

### Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

#### NBVC

##### Well-known Member
You haven't closed any of your Sum() functions.

=IF(SUM(M2:M19)>0,"NE ",IF(SUM(N2:N19)>0,"NW ",IF(SUM(O2:O19)>0,"SE ",IF(SUM(P2:P19)>0,"SW ",IF(SUM(Q2:Q19)>0,"MW ",IF(SUM(R2:R19)>0,"CAN ",IF(SUM(S2:S19)>0,"MX","")))))))

L

#### Legacy 5596

##### Guest
Duh!

You haven't closed any of your Sum() functions.

=IF(SUM(M2:M19)>0,"NE ",IF(SUM(N2:N19)>0,"NW ",IF(SUM(O2:O19)>0,"SE ",IF(SUM(P2:P19)>0,"SW ",IF(SUM(Q2:Q19)>0,"MW ",IF(SUM(R2:R19)>0,"CAN ",IF(SUM(S2:S19)>0,"MX","")))))))

Duh! how stupid can I be? Can I pretend its because its Friday? Thanks L

#### Legacy 5596

##### Guest
I had to fix it up more anyhow after you poked me to wake up, final form:

=IF(COUNTIF(M2:M19,"x")>0,"NE ","")&IF(COUNTIF(N2:N19,"x")>0,"NW ","")&IF(COUNTIF(O2:O19,"x")>0,"SE ","")&IF(COUNTIF(P2:P19,"x")>0,"SW ","")&IF(COUNTIF(Q2:Q19,"x")>0,"MW ","")&IF(COUNTIF(R2:R19,"x")>0,"CAN ","")&IF(COUNTIF(S2:S19,"x")>0,"MX","")

Thanks again

Replies
2
Views
96
Replies
16
Views
207
Replies
2
Views
69
Replies
5
Views
77
Replies
25
Views
1K