In the above eg- it should show the count value - 8
This requires an array formula. To enter an array formula, enter the formula into a cell and then hit Ctrl+Shift+Enter.
=SUM(IF(COUNTIF(OFFSET(A1:C5,ROW(A1:C5)-1,0,1,3),"<>""")>0,1,0))
Put this formula in D1:
=IF(COUNT(A1:C1)>0,1,0)
Copy the formula down for as many rows as you have.
Take the sum of column D.
Related
Need your help.
I have an excel sheet with two columns, like this:
I would to find an average of the number in the cells from column 2 that correspond to the numbers in column 1 which end either in 2 or 5. If column 2 has a blank cell or a letter, it should be ignored.
If one has the dynamic array formula FILTER():
=AVERAGE(FILTER(B2:B15,ISNUMBER(MATCH(--RIGHT(A2:A15),{2,5},0))))
If not then use this array formula:
=AVERAGE(IF(ISNUMBER(MATCH(--RIGHT(A2:A15),{2,5},0)),B2:B15))
Being an array formula it needs to be confirmed with Ctrl-Shift-Enter instead of Enter when exiting edit mode.
I have a set of data that will change so I need a formula to dynamically get a result.
From this set of data I end up with two columns, Dates and Amounts, like the following:
What I need is to be able to remove the duplicates from the Dates column, while summing the corresponding amounts. So each unique date will have its own row with an amount that is a sum of all the amounts with this date.
Desired Result:
How would I go about this? Can I do it in a formula or do I need VBA?
Fairly new to excel, thanks in advance.
As an alternative to pivot tables in C1 enter:
=MIN(A1:A100)
In C2 enter the array formula:
=IF(MIN(IF($A$1:$A$100>C1,$A$1:$A$100))<C1,"",MIN(IF($A$1:$A$100>C1,$A$1:$A$100)))
and copy down.Apply a Date format to column C.Column C extracts the unique dates from column A.
In D1 enter:
=SUMPRODUCT(--($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.
I need to find an excel formula that I can use to create a unique list of Item numbers from an array. I do not want to count them I just want to make a list of the Item Numbers. These part numbers are actually Alpha Numeric and can have repeating numbers through out the array multiple times. There is one other catch this list will have empty cells in it and could also be the first record in the array. This data is being pulled into Excel through a Jet report add-in for Excel.
Example: Starting in cell A1..A9
Item No.
<BLANK>
7810042050
783979
7810006045
7810006042
7810006032
<BLANK>
7810006022
7810006032
With values in column A, in C1 enter:
=MAX(A1:A10)
in C2 enter the array formula:
=MAX(IF(A$1:A$10<C1,A$1:A$10,""))
and copy down:
Array formulas must be entered with Ctrl + Shift + Enter rather than just the Enter key.
EDIT#1:
Chris Neilsen has pointed out that the values in column A are actually Text rather than Numeric. To accommodate this, two changes must be made to the formulas:
A1 must be excluded
the alphas must be converted to numeric.
So we will replace the normal formula:
=MAX(A1:A10)
with the array formula:
=MAX(--(A2:A10))
and replace:
=MAX(IF(A$1:A$10<C1,A$1:A$10,""))
with the array formula:
=MAX(IF(--(A$2:A$10)<C1,--(A$2:A$10),""))
and then copy down.
If you have alpha characters in the part numbers you can do this in 2 steps.
Both are array formulas and you need to use Ctrl-Shift-Enter
Col B - sorted list of items in Col A
B2 =IFERROR(INDEX($A$2:$A$10,MATCH(COUNTA($A$2:A2),COUNTIF($A$2:$A$10,"<="&$A$2:$A$10),0),1),"")
Col C - eliminate the duplicates
C2 = IFERROR(INDEX($B$2:$B$10, MATCH(0, COUNTIF($C$1:C1, $B$2:$B$10), 0)),"")
Copy both formulas down.
I tried to combine the two formulas but nesting an array (results in Col B) with varying row ranges did not work out. I could not find a way but the two formulas together will work.
Enter this Formula Array in B2 and copy to B3:B10
FormulaArrays are entered pressing [Ctrl] + [Shift] + [Enter] simultaneously, you shall see { and } around the formula if entered correctly
=IFERROR(
INDEX($A$2:$A$10,
MATCH(1,1+COUNTIF($B1:$B$1,$A$2:$A$10)+(($A$2:$A$10="")*1),0)*1),"")
I would like to add a check to my worksheet in Excel, to test if entries in a column have the same total number of characters. I know how to do it for two cells where I can simply use =IF(EXACT(LEN(A1),LEN(A2)),"Match","No Match") but what if I have a lot of cells to test against each other?
Example:
Add a helper column B with =LEN(A1), etc in each row, then a check cell in say C1 with =STDEV.P(B:B)=0. This will show TRUE if all entries in column A are the same length and FALSE otherwise.
Try this array formula (entered by holding down ctrl + shift while hitting enter):
=IF(AND(LEN(OFFSET($A$1,0,0,COUNTA($A:$A)))/LEN($A$1)=1),"Match","No Match")
or this normally entered formula:
=IF(AND(MMULT(LEN(OFFSET($A$1,0,0,COUNTA($A:$A))),1/LEN($A$1))=1),"Match","No Match")
You could also use the Std Dev calculation, as suggested by others, in an array (CSE) formula so as to avoid the helper column:
=IF(STDEV.P(LEN(OFFSET($A$1,0,0,COUNTA($A:$A)))),"No Match","Match")
Suppose I have two columns; A and B. each of which has 50 rows of data. I want to set the value of a third column, C, to the value of A corresponding to, say, the minimum value of B. Can I do this without writing a macro?
https://qph.is.quoracdn.net/main-qimg-7978d7e50a58000fc152952a980c09e3?convert_to_webp=true
Consider in C1:
=IF(B1=MIN(B:B),A1,"")
and copy down:
As you see, no macro is required.
If you have unique values in Column B i.e. there's only one minimum value in the column, you can use following formula. Enter this formula in Cell C1:
=INDEX(A:A,MATCH(MIN(B:B),B:B,0))
Or if you have a fixed range say till row 25, use following formula and change number of rows as required:
=INDEX(A1:A25,MATCH(MIN(B1:B25),B1:B25,0))
If you've repeating minimum value in Column B i.e. minimum value occurs more than one then try this array formula. Enter the formula in Cell C1 and drag it down till the row you want:
=IF(COUNTIF($B$1:$B$25, MIN(B:B))>=ROWS($A$1:A1),INDEX($A$1:$A$25, SMALL(IF(MIN(B:B)=$B$1:$B$25, ROW($B$1:$B$25)-MIN(ROW($B$1:$B$25))+1, ""), ROW(A1))), "")
This is an array formula so commit it by pressing Ctrl+Shift+Enter
Again if you want to use this formula for fixed rows say 25 then use following formula. Change number of rows as accordingly:
=IF(COUNTIF(B:B, MIN(B:B))>=ROWS($A$1:A1),INDEX(A:A, SMALL(IF(MIN(B:B)=B:B, ROW(B:B)-MIN(ROW(B:B))+1, ""), ROW(A1))), "")
Got the tips for array formula from here.