Excel =large formula - dynamic array - excel-formula

I have a date dropdown on Sheet1 (=Sheet1!B5)
This helps populate Sheet1 with values from Sheet ‘Data’. I have been using Vlookup with Match formula for others. (=VLOOKUP(G20,Data!A:Z,MATCH(Sheet1!$B$5,Data!$3:$3,0),FALSE))
But Im stuck on how to use =Large formula in same way. I am trying to take top 5 values per day – using date dropdown. I can’t figure out how to dynamically change the column letter in the array =large formula to take correct values corresponding date.
So far I can directly take top 5 from column C - =LARGE(Data!C44:C65,1)
But I want this work for column D onwards..
Thanks in advance

Use this formula:
=LARGE(INDIRECT("Data!" &ADDRESS(44,MATCH(1E+99,44:44)) & ":" & ADDRESS(65,MATCH(1E+99,44:44))),1)
It will find the right most column with numbers.
Or this one uses your match from the vlookup to choose the column:
=LARGE(INDIRECT("Data!" & ADDRESS(44,MATCH(Sheet1!$B$5,Data!$3:$3,0)) & ":" & ADDRESS(65,MATCH(Sheet1!$B$5,Data!$3:$3,0))),1)

Related

Vlookup with specific date showing N/A

I am trying to apply vllokup for a specific month of a specific year. My formula works for string lookup value but not works for date. here I attached my effort
First of all VLOOKUP() will not work in this case because VLOOKUP() always lookup values on first column of table then return value from corresponding row from specified column. So, you first column is strings and vlookup do not find dates on first column. Use Index/Match instead.
=INDEX(B3:B5,MATCH(D1,C3:C5,0))
You can also use FILTER() function.
=FILTER(B3:B5,C3:C5=D1)
Query() will also work-
=QUERY(B3:C,"select B where C= date '" & text(D1,"yyyy-mm-dd") & "'")
Vlookup works by searching columns to the left of the searched column. So you should modify your sheet to look like this (if possible) :
However, you should also take into account that the formatting of your cells could be misleading. If your D4cell has the value 1/Jan/2022 and your C6 cell has the value of 2/Jan/2022, then both of them will show as Jan 2022, but your formula will still return N/A because the real values of the cells are different.

EXCEL - Average if cells in a column contain any of the strings in a list (list specific to each row)

I would like to get a formula to calculate an "averageif" based on whether the text of a column ("Item" in the example), is included in a string that I have in another column ("Other items" in the example).
So for example for Item A, I would like to get the average of item B and C in column "Output".
Is there an easy way to do this? I thought about array-SEARCH but keep getting errors
One option could be SEARCH within SUMPRODUCT:
=SUMPRODUCT(ISNUMBER(SEARCH($A$2:$A$5,"," & C2 & ","))*$B$2:$B$5)/SUMPRODUCT(--ISNUMBER(SEARCH($A$2:$A$5,"," & C2 & ",")))
One can use FILTERXML:
=SUMPRODUCT(SUMIFS(B:B,A:A,FILTERXML("<t><s>"&SUBSTITUTE(C2,",","</s><s>")&"</s></t>","//s")))/SUMPRODUCT(COUNTIFS(A:A,FILTERXML("<t><s>"&SUBSTITUTE(C2,",","</s><s>")&"</s></t>","//s")))

COUNTIF cell description matches and within date range

Hi I am after some help with a COUNTIF formula, I want to add 1 to cell
if the 3 criteria are met (see image) =COUNTIF(K4:K20,D2 AND L4:L20,C6 AND M4:M20,B7) i can get the 2 count from =COUNTIF(K4:K20,D2) but the formula does not work with the AND L4:L20,C6 AND M4:M20,B7
Any help would be great
for first, I'd split your B column in two columns FROM and TO. This helps countifs to evaluate if time is after ( >= ) FROM and before (<) TO.
If you are asking what should you write in your C7 formula, this could be something like (according to columns in my screenshot):
=COUNTIFS(G:G,$C$5,H:H,">="&A6,H:H,"<"&B6,F:F,$B$2)
so use ">=" & cell to evaluate if time if after FROM columns; and "<" & cell to evaluate if is before TO column.
I paste this screenshot of I'd solve this problem:
screeshot
and here you have a working example

Vlookup all the values matching the search term instead of just one.

So the following formula returns only the first value from the range. I kinda need all the matching search results indexed instead of just 1.
=Vlookup("*" & B3 & "*",A:A,1,0)
SPREADSHEET LINK
With Google Sheets use Query:
=QUERY(A:A,"select A where A contains """ & B3 &"""")
Since you have the Excel tag use this formula for excel:
=IFERROR(INDEX(A:A,AGGREGATE(15,6,ROW($A$2:INDEX(A:A,MATCH("ZZZ",A:A)))/(ISNUMBER(SEARCH($B$3,$A$2:INDEX(A:A,MATCH("ZZZ",A:A))))),ROW(1:1))),"")
Copy/drag it down sufficient for your needs.
Another option is
=FILTER(A2:A, SEARCH(B3, A2:A))
Filters out those values where the string can be found and also supports wildcards within the string or could be extended to match a regular expression instead.
vlookup is designed to always give you one result. Either your query matches then it will return the value, else it will return an error. As you want all the values I would recommend a different approach.
Create a column next to your column (in your case A:A) and fill it with your condition =IF($A1 = ("*" & B3 & "*", 1, 0). This column should be filled with 0 and 1 depending on the content of your column B.
Do whatever you want with the values in column A, and take your newly created column as condition. For example to sum all values in column A that match your condition: =SUMIFS(A:A, B:B, "=1")
I hope this helps to streamline your Excel. If you need further help maybe elaborate on the content of your columns A and B and what you want to achieve with your =vlookup().

Excel multiple rows values addition

i am trying to add the formula that will sum first two rows and excel, put the result in the next column, then move down, take the next two values and put the result below the sum of the previuos one. (it is clear in the picture).
Please any advice would be helpful because my formula is taking the second value and add it on the next one which is not what i need. https://postimg.org/image/st4uie90j/ example
The following formula will work to do what you ask if the columns are adjacent and set the $A$1 to the first cell (top-left of your data set):
=SUM(OFFSET(INDIRECT("R" & (ROW($A$1) +(( ROW()-1)*2)) & "C" & (COLUMN()-1),FALSE),0,0,2,1))

Resources