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:eek:19>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", "")

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?
 

Some videos you may like

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
Joined
Aug 31, 2005
Messages
5,828
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 :oops:
 
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
 

Watch MrExcel Video

Forum statistics

Threads
1,113,956
Messages
5,545,177
Members
410,668
Latest member
Gaexel
Top