My spreadsheet has a-ag columns and 100+ rows with the final row being the sum of each column.
trying to do an average if column i has text in it, than add the dollar amount is same row column n,p,q,w than divide total by number of entries in column I row 100.
In english - if column I has text in it add the number is the same row columns n,p,q,w - my question is how to add only specific cells since other cells in the same row will have numbers also
Add a condition to an AVERAGE function by deconstructing it into a SUM divided by COUNTA array¹ formula.
In I12 as an array¹ formula,
=SUM(IF(ISNUMBER(I2:I11), I2:I11, N2:N11+P2:P11+Q2:Q11+W2:W11))/COUNTA(I2:I11)
¹ Array formulas need to be finalized with Ctrl+Shift+Enter↵. If entered correctly, Excel with wrap the formula in braces (e.g. { and }). You do not type the braces in yourself. Once entered into the first cell correctly, they can be filled or copied down or right just like any other formula. Try and reduce your full-column references to ranges more closely representing the extents of your actual data. Array formulas chew up calculation cycles logarithmically so it is good practise to narrow the referenced ranges to a minimum. See Guidelines and examples of array formulas for more information.
Related
I need a count if function that counts me the cells that meet a certain criteria. This should be done with countifs. The formula is the following:
=COUNTIFS(Orders!D:D;"*Ecolab*";Orders!B:B;">=01/01/2019";Orders!U:U;">=36";Orders!K:Q;">=1")This formula returns me an value type error.
This formula works well until I introduce the last condition orders!K:Q;">=1"
I would like a formula that counts if the word Ecolab is present in the cell; if the date is after or equal 01/01/2019; if the column U has more or equal than the number 36 and if there is at least a "1" in the cells in the row from column K to column Q. I could do this by easily replicating the countifs several times, (i.e =COUNTIFS(Orders!D:D;"*Ecolab*";Orders!B:B;">=01/01/2019";Orders!U:U;">=36";Orders!K:K;">=1")+COUNTIFS(Orders!D:D;"*Ecolab*";Orders!B:B;">=01/01/2019";Orders!U:U;">=36";Orders!L:L;">=1")+...........+COUNTIFS(Orders!D:D;"*Ecolab*";Orders!B:B;">=01/01/2019";Orders!U:U;">=36";Orders!Q:Q;">=1")
But I would rather not include such a long formula as it would create confusion for the ultimate user of the excel sheet
Per my comment above, you could use SUMPRODUCT (avoid using whole columns for that) or an array with OFFSET like this:
=SUM(COUNTIFS(Orders!D:D;"*Ecolab*";Orders!B:B;">=01/01/2019";Orders!U:U;">=36";OFFSET(Orders!J:J;0;{1;2;3;4;5;6;7});">=1"))
If the count for K:Q should be 1 when there may be more than one cell greater or equal to 1 in a single row then you need to apply OR criteria in a SUMPRODUCT.
SUMPRODUCT formulas should not use full column references; there is too much wasted calculation. The following is for rows 2:99; adjust for your own use.
=SUMPRODUCT(--ISNUMBER(SEARCH("ecolab", Orders!D2:D99)),
--(Orders!B2:B99>=DATE(2019, 1, 1)),
--(Orders!U2:U99>=36),
SIGN((Orders!K2:K99>=1)+(Orders!L2:L99>=1)+(Orders!M2:M99>=1)+(Orders!N2:N99>=1)+(Orders!O2:O99>=1)+(Orders!P2:P99>=1)+(Orders!Q2:Q99>=1)))
I am using INDEX(MATCH) to look up a value in one column using criteria from two different cells in another sheet. Here is the formula I am trying to use:
=INDEX(Sheet1!P:P,MATCH(1,(Sheet1!A:A=Sheet2!C$1)*(Sheet1!B:B=Sheet2!$B2),0))
Sheet1 is the array and column P contains the values I am wanting the formula to return. Column A in Sheet1 contains the values for the first criteria and Column B in Sheet1 contains the values for the second criteria. The criteria are represented in C1 and B2 of Sheet2. This will change as the cell is copied. Can anyone see any errors in this formula? It is returning a "value is not available for the formula or function."
This will have to be entered as an array formula¹ so the full column references should be cut down to a minimum size or you will experience unnecessary calculation lag as hundreds of thousands of blank cells are processed.
With text in column A,
=index(Sheet1!$P$1:index(Sheet1!$P:$P, match("zzz", Sheet1!$A:$A)),
match(1, (Sheet1!$A$1:index(Sheet1!$A:$A, match("zzz", Sheet1!$A:$A))=Sheet2!C$1)*
(Sheet1!$B$1:index(Sheet1!$B:$B, match("zzz", Sheet1!$A:$A))=Sheet2!$B2), 0))
With numbers or dates in column A,
=index(Sheet1!$P$1:index(Sheet1!$P:$P, match(1e99, Sheet1!$A:$A)),
match(1, (Sheet1!$A$1:index(Sheet1!$A:$A, match(1e99, Sheet1!$A:$A))=Sheet2!C$1)*
(Sheet1!$B$1:index(Sheet1!$B:$B, match(1e99, Sheet1!$A:$A))=Sheet2!$B2), 0))
You did not have absolute reference anchors (e.g. $ ) in the original Sheet1 range references but the way you had them set up for the criteria from Sheet2 led me to believe that you required them for both row and column.
If you have column header labels in row 1, change A1, B1 and P1 to A2, B2 and P2.
¹ Array formulas need to be finalized with Ctrl+Shift+Enter↵. If entered correctly, Excel with wrap the formula in braces (e.g. { and }). You do not type the braces in yourself. Once entered into the first cell correctly, they can be filled or copied down or right just like any other formula. Try and reduce your full-column references to ranges more closely representing the extents of your actual data. Array formulas chew up calculation cycles logarithmically so it is good practise to narrow the referenced ranges to a minimum. See Guidelines and examples of array formulas for more information.
So I have three columns I'm working with.
The first is a list of category IDs.
The second and third are category ID matched with unique user IDs.
I'm trying to say if the value in Column A matches the value in Column B, then return the value of every instance in Column C. VLOOKUP only returns the first value where there's a match, and I'm trying to return all values where there's a match.Thanks for any help!
Try this array formula in Cell D5 and drag to the right and down:
={INDEX($C:$C, SMALL(IF($A$1=$B:$B, ROW($B:$B)-MIN(ROW($B:$B))+1, ""), COLUMN(A1)))}
It will give all matches for the value in Cell A1 in a horizontal list.
Array formulas need to be finalized with Ctrl+Shift+Enter↵. If entered correctly, Excel with wrap the formula in braces (e.g. { and }). You do not type the braces in yourself. Once entered into the first cell correctly, they can be filled or copied down or right just like any other formula. Try and reduce your full-column references to ranges more closely representing the extents of your actual data. Array formulas chew up calculation cycles logarithmically so it is good practise to narrow the referenced ranges to a minimum. See Guidelines and examples of array formulas for more information.
iam trying to create a COLUMN using array from another sheet of same workbook that omit cell with empty value like shown in column C which is I required
column A Column B Column C
A 15 A
B 10 B
C BLANK D
D 7 F
E BLANK
F 11
I tried this code for got error #NUM
=IFERROR(INDEX('DATE WISE CONSUMPTION'!B$30:B$87,SMALL(IF('DATE WISE CONSUMPTION'!G$30:G$87<>"",ROW('DATE WISE CONSUMPTION'!B$30:B$87)-ROW('DATE WISE CONSUMPTION'!B$30)+1),ROWS(D$30:D31))),"")
A 'list-unique-with-conditions' array formula requires a single cell above the first cell with the formula in order to avoid circular references.
In an unused cell to the right as an array formula¹,
=IFERROR(INDEX('DATE WISE CONSUMPTION'!B$30:B$87, MATCH(0, IF(LEN('DATE WISE CONSUMPTION'!G$30:G$87), COUNTIF('DATE WISE CONSUMPTION'!J$29:J29, 'DATE WISE CONSUMPTION'!B$30:B$87&""), 1), 0)), "")
Fill down as necessary.
Your formula would have worked as an array formula finalized with CSE and this slight modification,
=IFERROR(INDEX('DATE WISE CONSUMPTION'!B$30:B$87,SMALL(IF('DATE WISE CONSUMPTION'!G$30:G$87<>"",ROW('DATE WISE CONSUMPTION'!B$30:B$87)-ROW('DATE WISE CONSUMPTION'!B$30)+1),ROW(1:1))),"")
You were starting off with ROWS(D$30:D31) which resolves to 2 not 1 so the SMALL function was returning the second match to start off with, not the first.
¹ Array formulas need to be finalized with Ctrl+Shift+Enter↵. If entered correctly, Excel with wrap the formula in braces (e.g. { and }). You do not type the braces in yourself. Once entered into the first cell correctly, they can be filled or copied down or right just like any other formula. Try and reduce your full-column references to ranges more closely representing the extents of your actual data. Array formulas chew up calculation cycles logarithmically so it is good practise to narrow the referenced ranges to a minimum. See Guidelines and examples of array formulas for more information.
I will pose the issue with an example. Attached is a print screen of an excel excerpt.
I would like to sum the numbers in column B that matches 2 conditions (green rows in excel). First one: column F equal to "closed". Second one: column C equal to those numbers which in turn matches the following condition: column F equal to "Partial Sold".
I try with the following matrix formula, but I only got the sum that matches these conditions: column F equal "closed" and column C equal "1".
=SUMPRODUCT($D$66:$D$86,IF($F$66:$F$86="Closed",1,0),IF($C$66:$C$86=INDEX($C$66:$F$86,SMALL(IF($F$66:$F$86="Partial Sold",$C$66:$C$86),ROW(1:20)),1),1,0))
Excel Data: This is a print screen
You can produce this with an array¹ formula based on SUM and INDEX with a second nested INDEX delivering the numbers from column C that match Partial Sold. Due to the array formula's cyclic calculation, you have to flip the nested conditional array with the TRANSPOSE function in order that it does not process in-line with the other factors.
The array¹ formula in H4 is,
=SUM(INDEX(D3:D23*(F3:F23="Closed")*(C3:C23=TRANSPOSE(INDEX(C3:C23*(F3:F23="Partial Sold"), , ))), , ))
¹ Array formulas need to be finalized with Ctrl+Shift+Enter↵. Once entered into the first cell correctly, they can be filled or copied down or right just like any other formula. Try and reduce your full-column references to ranges more closely representing the extents of your actual data. Array formulas chew up calculation cycles logarithmically so it is good practise to narrow the referenced ranges to a minimum. See Guidelines and examples of array formulas for more information.