Len Function for Multiple Cells - excel

need a character count function like the len function but I need it to take a range (i.e A1:D22). What do you suggest I use? I'm looking for something other than fill down on the len function across multiple columns and rows and then sum it all. I'm trying to do it with one function. This is to use it as a check value.

If I understand well, you can use the following array formula:
=SUM(LEN(A1:D22))
Note: press CTRL+SHIFT+ENTER to enter the formula (because this is array formula)

You can use an array formula
=SUM(LEN(A1:D22))
Enter and hit control + shift + Enter

Related

Lookup excel return min value if no match found

If number from first coulmn is found in the second column, it should return that number.
If number from first coulmn is not found in the secound column, it should return closest possible min value
You can use vlookup() like this, BUT you need to sort the values:
In C1 enter the array formula:
=MAX(IF(B:B<=A1,B:B))
and copy downward:
Array formulas must be entered with Ctrl + Shift + Enter rather than just the Enter key. If this is done correctly, the formula will appear with curly braces around it in the Formula Bar.
NOTE:
Sorting is not required.
Array entry is not required if you are using Excel 365.
Another option is SUMPRODUCT:
=SUMPRODUCT(MAX(--($B$1:$B$12<=A1)*$B$1:$B$12))
It works on Excel 2007 or higher, no need of array entered formula and no need of sorting.

Is there an equivalent of OFFSET for array contents

I would like to dynamically modify the dimensions of array contents just like OFFSET's height and width do with ranges.
Let A1:A5 equal to 1, 2, 3, 4, 5
if I want to get the first 3 values with offset (using a range):
=OFFSET(A1:A5,,3,1) => {1;2;3}
But this doesn't work:
=OFFSET({1;2;3;4;5},,,3,1)
Is there an equivalent to OFFSET but for array contents? This is of course part of a much bigger array formula which forces me to work with array contents instead of ranges.
Of course I could easily do it with VBA but I'd rather not, let's call this company limitations...
Thank you very much for your help.
PS: first time posting here, any remarks/advice to improve my questions are most welcome.
Hi & Welcome to the forum. I think you are almost correct - the only thing you need to do is to press Ctrl+Shift+Enter in order to turn your OFFSET formula into an Array formula:
In the example below I have combined your OFFSET with SUMPRODUCT formula (which works with ranges and arrays). As you can see the result of SUMPRODUCT function is correct (i.e. sum of first 3 values):
Let me know if this is what you were looking for.
You can use INDEX to return an array:
INDEX({1;2;3;4;5},N(IF({1},ROW(INDEX($ZZ:$ZZ,1):INDEX($ZZ:$ZZ,3)))))
This will force any formula that uses this to become an array formula and as such must be entered with Ctrl-Shift-Enter instead of Enter when exiting edit mode.
Change the ,1 to the start position desired and the 3 to the end position desired.
N(IF({1},ROW(INDEX($ZZ:$ZZ,1):INDEX($ZZ:$ZZ,3))))
Creates an array of numbers from the 1 to the 3 in this case. Which is passed to the INDEX and the INDEX will then return an array of the array {1,2,3}
As you can see with this sum of that array:

SUMIF NOT Range is in Range

I'm trying to sum only if a value from a collection is not in a set list of values.
Given:
and
and
I've Tried:
=SUM(SUMIF(M7:M10,"<>" & X2:X4,H7:H10))
I should Expect to see 10,000 (for row 8) But it keeps returning a nonsensical value (120,000).. How can I modify this to correctly SUMIF not in the range.
You can use Array/CSE formula:
=SUM(IF(COUNTIF($X$2:$X$4,M7:M10)=0, H7:H10, 0))
Just hit Ctrl+Shift+Enter to enter that in so it gets the squirrelly brackets around it.
Or you can hit it with sumproduct and some sneaky boolean logic to avoid the array formula:
=SUMPRODUCT(NOT(COUNTIF($X$2:$X$4,M7:M10))*H7:H10)
Take one of the answers in your other thread and substract it from:
SUM(H7:H10)
That is:
=SUM(H7:H10)-SUM(SUMIF(M7:M10,X2:X4,H7:H10))
Entered as an Array Formula

Trim values in array?

The match excel function takes an array or table as second parameter. Is there a way to trim the values of the array before feeding to match function?
I am looking for something like:
=MATCH("bat", TRIM(A1:A12), 0)
Thanks!
It will work as an array formula:
Array formulas must be entered with Ctrl + Shift + Enter rather than just the Enter key. If this is done correctly, the formula will appear with curly braces around it in the Formula Bar.

Excel: find the Max of an array with same names

I have searched the Net and tried multiple solution which never worked. You are my last hope.
I have a table like that:
NAMES.......... VALUES
A...........................4
A...........................1
B...........................4
B...........................3
B...........................2
B...........................1
C...........................4
C...........................3
As you can see, the first column has names only where the second one values.
Both Names and Values often repeat them self.
The idea is to TAG the names (first column) with the MIN value taken from the second column.
So the correct result should be:
NAMES.......... VALUES
A...........................1
B...........................1
C...........................3
I am trying to do that through Excel using the INDEX+Match formula where I am trying to add a MIN formula without success:
=MIN(INDEX($D$25:$D$36,MATCH(C25,$C$25:$C$36,0),1))
I have put the MIN everywhere but none seems to work. Which is the correct syntax and if this is not the right solution, which formula might do the job?
Thank you for your time and help
With data in column A and B, in C1 through C3 enter:ABC then in D1 enter the array formula:
=MIN(IF(A$1:A$100=C1,B$1:B$100,""))
and copy down:
Array formulas must be entered with Ctrl + Shift + Enter rather than just the Enter key. If this is done correctly, the formula will appear with curly braces around it in the Formula Bar.
If the data never changes, a Pivot Table is easier to implement.
Two non-array alternatives.
With the newer MINIFS function.
=minifs(d:d, c:c, c25)
Using INDEX in its array format but entered as a standard formula,
=min(index((d$25:d$36)+(c$25:c$36<>c25)*1e99, , ))

Resources