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

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
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","")))))))
 
Upvote 0
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:
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,214,784
Messages
6,121,535
Members
449,037
Latest member
tmmotairi

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
Back
Top