# 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(o219>0, "SE ", if(sum(p219>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

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
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!

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

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
21
Views
381
Replies
4
Views
265
Replies
12
Views
898
Replies
1
Views
294
Replies
6
Views
514

Threads
1,219,106
Messages
6,146,297
Members
450,687
Latest member
philyatpips

### 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

### 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