Array not outputting last cell - excel

Following on from this question:
Array that outputs cells in a column AFTER a certain point
I have made a simplified example to test the formula
=IFERROR(INDEX($A$1:$A$11,SMALL(IF(ROW($A$1:$A$11)-MIN(ROW($A$1:$A$11))>MATCH("WORD",$A$1:$A$11,0),ROW($A$1:$A$11)-MIN(ROW($A$1:$A$11))),ROWS(A$1:A1))),"")
Here is my sample data In column A, and array formula in column B (Entered with ctrl + shift + enter)
:
The array is outputting the cells that are found after the WORD. However, you can see that 10 is not being displayed by the array.
I will display if I change all ranges in the formula to A1:A12, but this is not correct surely.
What is happening here?

You need to add 1 to the row output from the small, 11 - 1 = 10, So then you need to deal with the > Match by using >= MATCH:
=IFERROR(INDEX($A$1:$A$11,SMALL(IF(ROW($A$1:$A$11)-MIN(ROW($A$1:$A$11))>=MATCH("WORD",$A$1:$A$11,0),ROW($A$1:$A$11)-MIN(ROW($A$1:$A$11))+1),ROWS(A$1:A1))),"")
Being an array formula it must be confirmed with Ctrl-Shift-Enter instead of Enter when exiting edit mode. If done correctly then Excel will put {} around the formula.

Related

How to create Excel list from row title including COUNTIF statement?

I have created a spreadsheet with the tally function =COUNTIF(E$2:H$41," * "&$A85&" * "), which is working, but now I would like to add an additional column that lists what groups those tallies occur.
For example, say " * "&$A85&" * " is searching for the word Apple in E$2:H$41 and it was found in E17. I would want the title of that row to show. For this case Fruit from cell A17. If there were other rows in which Apple was found, say red, I would like those listed as well.
I have tried using the INDEX command but cannot get the formula to work that way.
Any help is appreciated.
You didn't say which column your title is in, but if were in column D then the formula below should work. if it's in column A then change the start to =INDEX(A2:A41.
=INDEX(A2:A41,MATCH(1,(ISNUMBER(FIND($A85,E2:E41)))+(ISNUMBER(FIND($A85,F2:F41)))+(ISNUMBER(FIND($A85,G2:G41)))+(ISNUMBER(FIND($A85,H2:H41))),0))
It's an array formula so you need to confirm with Ctrl + Shift + Enter
It's an index formula that indexes D2:D41 and then the match has a look at the 4 columns E, F, G, and H with OR (confusingly the + sign denotes or).
Because you wanted to search within the cell using *, I used ISNUMBER(FIND($A85,G2:G41)) which returns the character number if it finds the text.
To return more than 1 title
=IFERROR(INDEX($A$2:$A$41,SMALL(IF((ISNUMBER(FIND($A$85,$E$2:$E$41)))+(ISNUMBER(FIND($A$85,$F$2:$F$41)))+(ISNUMBER(FIND($A$85,$G$2:$G$41)))+(ISNUMBER(FIND($A$85,$H$2:$H$41))),ROW($A$2:$A$41)-1),ROW(1:1)),1),"")
It's also an array formula so don't forget to Ctrl + Shift + Enter to add the curly brackets.
This formula in a single cell will not return multiple results so you need to drag/copy the formula down enough cells to accommodate as many results as you think will be returned.
each formula will be the same except for the part at the end ROW(1:1:) which will change to ROW(2:2:), ROW(3:3:).
I have placed the formula in cells B85 and B86 and below but I would advise against using this formula in an area of a sheet if you are going to insert and delete rows above as this sometimes breaks the ROW(1:1:) references. I normally put a formula like this on a different sheet from the source data.

IF formula contains certain text for entire column

So for this excel file, I need to calculate a percent for one subject which has several rows. With this, I have thus come up with:
=IF(COUNT(SEARCH("b0021",B3:B14)), (SUM(T3:T14))/12, "no")
Column B Column T
b0021 1
b0021 0
...
b0025 1
However, this does not seem to work, as to search that ALL the cells contain this text (right now it looks that at least one cell contains the text, which is not what I want to do if it should be one for the subject).
Any ideas of how I can do this?
Thank you.
You need to edit your cell and press Ctrl + Shift + Enter to make it array formula
Your formula =COUNT(SEARCH("b0021",B3:B14)) would start showing result only if it's in brackets
{=COUNT(SEARCH("b0021",B3:B14))}
In other words just add { } to make it formula array or by pressing Ctrl + Shift + Enter while editing your formula
{=IF(COUNT(SEARCH("b0021",B3:B14)), (SUM(T3:T14))/12, "no")}
It looks from your formula that you would need to use =SUMIFS formula rather than what you have:
=SUMIFS(T3:T14,B3:B14,"b0021")/SUM(T3:T14)

Excel find lower distinct value in list

I'm trying to find in a list the lowest unique value.
I tried to find out a way on google, but nothing seem to work like I want.
What i have :
John;5
Leon;7
Mark;5
Bob;3
Peter;3
Louis:4
Desired result: "4" because it's the lower unique value.
Suppose I add in the original list:
Alex;4
The new result is about to be "7" because it's the new lowest unique value.
my excel sheet :
Assuming your data is setup so that names are in column A and values are in column B so that it looks like this:
In cell D2 (or wherever you want the result), use this array formula (Note that array formulas must be confirmed with CTRLSHIFTENTER and not just ENTER):
=MIN(IF(COUNTIF(B2:B20,B2:B20)=1,B2:B20))
You'll know you've entered it as an array formula correctly because you'll see it surrounded by curly braces {=formula}in the formula bar. Do NOT add the curly braces manually.
You'll also notice that I have extra rows in there than just the used rows. Normally I'd suggest using a dynamic named range, but this works for now. So when you add the new line of Alex; 4, you get this:
And you can see the formula now has the new correct value of 7.
With data in columns A and B, in C1 enter:
=COUNTIF(B:B,B1)
and copy down. Then in another cell enter the array formula:
=MIN(IF(C:C=1,B:B))
Array formulas must be entered with Ctrl + Shift + Enter rather than just the Enter key.
To avoid speed problems, make the limits on the ranges as small as possible:
=MIN(IF(C1:C6=1,B1:B6))

MS Excel create virtual column to use in formula

I want to do something similar to summing 1/x from 1 to 100 without creating an extra column to help with the calculation. I want my first column to be the numbers 1 through 100. And I want a cell to show the sum of 1/x where x is each cell in the first column. Currently the only way I can think to do this is to create a second column to do 1/x for each individual cell then sum the second column. Is there any solution to doing this without having to create the second column?
Thanks!
You can use this "array formula"
=SUM(1/A1:A100)
confirmed with CTRL+SHIFT+ENTER
....or avoid array entry by using SUMPRODUCT
=SUMPRODUCT(1/A1:A100)
both versions assume you don't have zeroes (or blanks) in A1:A100
if you might have zeroes or blanks then use this array formula
=SUM(IF(A1:A100,1/A1:A100))
if you mean 1 + 1/2 + 1/3 + ... + 1/100, use following array formula (entered by Ctrl+Shift+Enter instead of just Enter):
=sum(1/row(A1:A100))
You need to use an array formula as below:
{=SUM(1/A1:A100)}
where A1:A100 contains 1 to 100
You create the array formula bu typing the formula as =SUM(1/A1:A100) and then pressing Control-Shift-Enter.
If you do it correctly the formula then shows up with the curly brackets {} but you don't enter the curly brackets yourself.

How to sum all cells that contains only time in excel?

Some cells contains time and some of them '#VALUE!', '######' and just text.
I want to sum all cells that contains only time.
Meanwhile I wrote =SUMIF(D13:D43,"<>#VALUE!"), but it works only if the cell contains '#VALUE!'
How I can do this?
Assuming your range is from D2:D8, use the following array formula.
=SUM(IF(ISERROR(D2:D8),"",D2:D8))
To make an array formula press CTRL + SHIFT + ENTER when done writing, instead of just ENTER>

Resources