Skip to content

Commit f4b4a20

Browse files
committed
worksheet summarise from columns
1 parent 7d4619a commit f4b4a20

File tree

1 file changed

+36
-2
lines changed

1 file changed

+36
-2
lines changed

Worksheet Functions.md

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11

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.
33
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.
57

68
## Calculate text as Zero
79

@@ -121,3 +123,35 @@ http://superuser.com/questions/453041/grouping-labels-and-concatenating-their-te
121123

122124
http://www.clearlyandsimply.com/clearly_and_simply/2011/06/emulate-excel-pivot-tables-with-texts-in-the-value-area-using-formulas.html
123125

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

Comments
 (0)