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?
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.

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
 

Forum statistics

Threads
1,143,637
Messages
5,719,972
Members
422,253
Latest member
frankie2016tata

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top