Sherwood Botsford
New Member
I'm looking for additions to excel. Some of these I've mentioned to members of this group in private emails. Rather than learn VBA then reinvent the wheel, I'm hoping that these wheels are kicking around somewhere.
Most of these ideas have as a goal making formulas simpler. Some of these INDEX MATCH MATCH COUNTIF formulas really make my brain hurt. Excel already has a reputation for being a write only language.
Some of these exist in Google Sheets
=FILTER (Range, criteria1, [criteria2, criteria3...]) returns rows (usually) that meet the criteria.)
=UNIQUE(Range,[list of columns or rows]) With no option parameter uses all columns, otherwise only checks the ones in the list.
=SORT(Range,[list of columns or rows])
The same sort of thing that in excel takes these two columns is:
=IF(COUNTIF($D4,$P$4 & "*")>0,$D4 & " " & $E4,"")
=INDEX($Q$4:$Q$25,MATCH(0,INDEX(COUNTIF($R$3:$R3,$Q$4:$Q$25),0,0),0))
in sheets is FILTER(Q4:Q25, REGEXMATCH(P4,Q4:Q25))
To get a sorted unique list
= SORT(UNIQUE(FILTER(Q4:Q25, REGEXMATCH(P4,Q4:Q25))))
But even this exceeds most users grasp. (If a formula has more that 3 sets of parentheses make simpler syntax)
Better: =UNIQUELIST(RANGE,columns,sort options)
Range can be 2d, columns are range relative, but can be + or -, a minus column is sorted descending.
*****
Here's another idea dead simple to implement.
For all the IS* booleans provide a negated version
So NOT(ISBLANK(foo)) becomes NOTBLANK(foo) Reduces the parenthesis count, improves clarity.
*****
=TIMESTAMP(Range,options) returns a time when one of the options is true.
=LASTEDIT(Range,"Row"|"Col") returns absolute row or column number of the last edited cell in the range.
=HEAD(range,count) returns "count" from the start of the range.
=TAIL(range,count) returns "count" rows from the end of the range.
Combine head, with sort and unique, to get a real time lists of important changes.
SMALLTEXT(range,cardinal,options) LARGETEXT(range,cardinal,options) works like SMALL and LARGE but for text. Options control sorting. Default is dictionary order for your locale.
REGEXMATCH(Expression, Cell or Range) The expression is in quotes. Uses full regular expressions to match. Does NOT have the -1,0,1 option, but may have an option for 'greedy' vs 'minimal' match, as well as an option for plain or extended regular expressions. I suggest you follow pcre syntax. (www.pcre.org)
VFetch/HFetch have well known limitations, and INDEX MATCH are often used as a more robust replacement. But Match returns a relative number, which then to use you need offset
I would like to see something like
=VFETCH(what to look for, column range to search, column to return, options)
options: Cardinal: which one to return -- also accepts the words, "First" and "Last"
E.g. VFETCH("aardvarks",F2:F60,A2:A60,2)
Searches for the 2nd occurrence of aardvark in F2:F60, and returns the corresponding element from A2:A60.
Column range is potentially a 2d range.
In array context returns all of the matches starting with cardinal.
This has a simpler syntax, and since you have explicit references to columns, not relative ones in ranges, it should be more robust against inserting a new column.
Similarly HFETCH
***
Combine VFETCH and HFETCH for two way lookups.
=INTERSECT(item in column, item in row,Colrange to search, Row range to search, options)
***
RFETCH(item to look for, 2D range,options) returns the row number.
options: row or column. search by row or by column
Cardinal: is which one to return, default 1, can also be "Last"
Similarly CFETCH
Returns the absolute row/column so OFFSET isn't needed.
***
QUERY https://support.google.com/docs/answer/3093343
This is one that I think there is in Windows Excel but you have to add on the ODBC data package, unavailable on Mac.
In essence you can treat a sheet or block as a database and run what amounts to a database SQL lookup on it.
Most of these ideas have as a goal making formulas simpler. Some of these INDEX MATCH MATCH COUNTIF formulas really make my brain hurt. Excel already has a reputation for being a write only language.
Some of these exist in Google Sheets
=FILTER (Range, criteria1, [criteria2, criteria3...]) returns rows (usually) that meet the criteria.)
=UNIQUE(Range,[list of columns or rows]) With no option parameter uses all columns, otherwise only checks the ones in the list.
=SORT(Range,[list of columns or rows])
The same sort of thing that in excel takes these two columns is:
=IF(COUNTIF($D4,$P$4 & "*")>0,$D4 & " " & $E4,"")
=INDEX($Q$4:$Q$25,MATCH(0,INDEX(COUNTIF($R$3:$R3,$Q$4:$Q$25),0,0),0))
in sheets is FILTER(Q4:Q25, REGEXMATCH(P4,Q4:Q25))
To get a sorted unique list
= SORT(UNIQUE(FILTER(Q4:Q25, REGEXMATCH(P4,Q4:Q25))))
But even this exceeds most users grasp. (If a formula has more that 3 sets of parentheses make simpler syntax)
Better: =UNIQUELIST(RANGE,columns,sort options)
Range can be 2d, columns are range relative, but can be + or -, a minus column is sorted descending.
*****
Here's another idea dead simple to implement.
For all the IS* booleans provide a negated version
So NOT(ISBLANK(foo)) becomes NOTBLANK(foo) Reduces the parenthesis count, improves clarity.
*****
=TIMESTAMP(Range,options) returns a time when one of the options is true.
=LASTEDIT(Range,"Row"|"Col") returns absolute row or column number of the last edited cell in the range.
=HEAD(range,count) returns "count" from the start of the range.
=TAIL(range,count) returns "count" rows from the end of the range.
Combine head, with sort and unique, to get a real time lists of important changes.
SMALLTEXT(range,cardinal,options) LARGETEXT(range,cardinal,options) works like SMALL and LARGE but for text. Options control sorting. Default is dictionary order for your locale.
REGEXMATCH(Expression, Cell or Range) The expression is in quotes. Uses full regular expressions to match. Does NOT have the -1,0,1 option, but may have an option for 'greedy' vs 'minimal' match, as well as an option for plain or extended regular expressions. I suggest you follow pcre syntax. (www.pcre.org)
VFetch/HFetch have well known limitations, and INDEX MATCH are often used as a more robust replacement. But Match returns a relative number, which then to use you need offset
I would like to see something like
=VFETCH(what to look for, column range to search, column to return, options)
options: Cardinal: which one to return -- also accepts the words, "First" and "Last"
E.g. VFETCH("aardvarks",F2:F60,A2:A60,2)
Searches for the 2nd occurrence of aardvark in F2:F60, and returns the corresponding element from A2:A60.
Column range is potentially a 2d range.
In array context returns all of the matches starting with cardinal.
This has a simpler syntax, and since you have explicit references to columns, not relative ones in ranges, it should be more robust against inserting a new column.
Similarly HFETCH
***
Combine VFETCH and HFETCH for two way lookups.
=INTERSECT(item in column, item in row,Colrange to search, Row range to search, options)
***
RFETCH(item to look for, 2D range,options) returns the row number.
options: row or column. search by row or by column
Cardinal: is which one to return, default 1, can also be "Last"
Similarly CFETCH
Returns the absolute row/column so OFFSET isn't needed.
***
QUERY https://support.google.com/docs/answer/3093343
This is one that I think there is in Windows Excel but you have to add on the ODBC data package, unavailable on Mac.
In essence you can treat a sheet or block as a database and run what amounts to a database SQL lookup on it.