|
1 | 1 |
|
2 |
| -This file does NOT contain VBA code, but instead useful tips and knowledge about Worksheet Functions. |
| 2 | +This file does NOT contain VBA code, but instead useful tips and knowledge about Formulas for use in Spreadsheets. |
3 | 3 | It gives guidance about using the Built-In functions in Excel to build handy features using plain old worksheets
|
4 |
| -without needing any macro code or other 'executables' |
| 4 | +without needing any macro code or other 'executables'. |
| 5 | +Many of thses will also work in derivatives, |
| 6 | +suchg as LibreOffice, Google Sheet, Excel web. |
5 | 7 |
|
6 | 8 | ## Calculate text as Zero
|
7 | 9 |
|
@@ -121,3 +123,35 @@ http://superuser.com/questions/453041/grouping-labels-and-concatenating-their-te
|
121 | 123 |
|
122 | 124 | http://www.clearlyandsimply.com/clearly_and_simply/2011/06/emulate-excel-pivot-tables-with-texts-in-the-value-area-using-formulas.html
|
123 | 125 |
|
| 126 | +## If Any Or |
| 127 | + |
| 128 | +Some tables are not about myriad data, but position. |
| 129 | +You may have a series of columns, some rows of which contain a mark, some of which contain another mark, but many might be left blank. |
| 130 | + |
| 131 | +Scenario: |
| 132 | + |
| 133 | +You might want a summary row above |
| 134 | +that would not add, but tell whether a column contained any instances of a character, or of another, or nothing (of significance). |
| 135 | + |
| 136 | +Logic: |
| 137 | + |
| 138 | +* If any of the cells below contain X then X, |
| 139 | +* otherwise |
| 140 | + * if any of the cells below contain Y then Y, |
| 141 | + * otherwise blank. |
| 142 | + |
| 143 | +``` |
| 144 | +=IF(COUNTIF(C2:C20,"X"),"X",IF(COUNTIF(C2:C20,"Y"),"Y","")) |
| 145 | +``` |
| 146 | + |
| 147 | +or if you want to make the first case sensitive |
| 148 | + |
| 149 | +``` |
| 150 | +=IF(SUMPRODUCT(--EXACT("X",C2:C20)),"X",IF(COUNTIF(C2:C20,"x"),"x","")) |
| 151 | +``` |
| 152 | + |
| 153 | +and an alternative might be using |
| 154 | + |
| 155 | +``` |
| 156 | +SUMPRODUCT(--ISNUMBER(FIND("X",C4:C17))) |
| 157 | +``` |
0 commit comments