# Simplify formula

#### Iridium

##### Well-known Member
Its Monday morning and I haven't drunk enough coffee to get my brain functioning yet. My formula does what I want it to but its a bit unwieldy - any ideas to simplify?

=IF(OR(N20="",N21="",P20="",P21="",N26="",N27="",P26="",P27=""),"",IF(AND(N20="Pass",N21="Pass",P20="Pass",P21="Pass",N26="Pass",N27="Pass",P26="Pass",P27="Pass"),"Pass",IF(OR(N20="Second level testing",N21="Second level testing",P20="Second level testing",P21="Second level testing",N26="Second level testing",N27="Second level testing",P26="Second level testing",P27="Second level testing"),"Second level testing","Fail")))

### Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.

#### Andrew Poulsom

##### MrExcel MVP
You can use this normal formula:

=IF(COUNTIF(N20:P21,"")+COUNTIF(N26:P27,""),"",IF((COUNTIF(N20:P21,"Pass")+COUNTIF(N26:P27,"Pass"))=12,"Pass",IF(COUNTIF(N20:P21,"Second level testing")+COUNTIF(N26:P27,"Second level testing"),"Second level testing","Fail")))

or this array formula:

=IF(COUNT(IF(N20:P21,N26:P27="")),"",IF((COUNT(IF(N20:P21,N26:P27="Pass")))=12,"Pass",IF(COUNT(IF(N20:P21,N26:P27="Second level testing")),"Second level testing","Fail")))

remembering to press Ctrl+Shift+Enter not just enter.

#### Iridium

##### Well-known Member
Thanks for that - knew there had to be an easier way. Cheers

#### rsainath

##### New Member
My query hopefully exlained well here:

Want to create a simple table for stock market calculations. As I progress creating formulas from one column to the next each formula is in some cases (not surprisingly) dependent on the results of the previous formula. That's OK if it's a simple table with few formulas. But as the "dependent" formulas get more complex that could potentially slow down the calculations. Regardless, after viewing the formulas, I replaced these formulas so they contain ONLY the INDEPENDENT variables and don't have to depend on "chain" results. But this replacement process could take forever in a large spreadsheet having complex formulas. Is there an easier way to do this replacement? Thanks people.

and shows three tables - the original "dependent" formulas, values and the revised formulas with INDEPENDENT variables. Hope you are able to see it.

Replies
3
Views
77
Replies
0
Views
197
Replies
1
Views
588
Replies
0
Views
1K
Replies
1
Views
2K

### Forum statistics

1,143,640
Messages
5,719,984
Members
422,256
Latest member
downeybm ### 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.

### Which adblocker are you using?    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

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