Array formula where i need to find weighted average - arrays

I am trying to find a weighted avg score for each member. So column A for me is the member list for each loan. Column BC is where scores are. I will weight them by the principal balance and that is column K. I put the unique member numbers in column BF. I tried the formula below but it doesn't work, I appreciate any suggestions:
=IF($A$6:$A$46375=BF6,$BC$6:$BC$46375*$H$6:$K$46375)/SumIF($A$6:$A$46375=BF6,$BC$6:$BC$46375))

Two things:
Use Sumproduct on the numerator:
SUMPRODUCT(($A$6:$A$46375=BF6)*$BC$6:$BC$46375*$H$6:$K$46375)
The SUMIF has a typo, You do not use the = in that manner in a SUMIF:
SUMIF($A$6:$A$46375,BF6,$BC$6:$BC$46375)
So together:
=SUMPRODUCT(($A$6:$A$46375=BF6)*$BC$6:$BC$46375*$H$6:$K$46375)/SUMIF($A$6:$A$46375,BF6,$BC$6:$BC$46375)
It is not a CSE array formula. It does not require Ctrl-Shift-Enter.

array formula
write
=sum(if(A6:A46375=BF6,BC6:BC46375*K6:K46375,0)/sum(if(A6:A46375=BF6,BC6:BC46375,0))
then press ctrl+shift+enter

Related

averageifs w/ multiple average ranges in different columns

=IFERROR(AVERAGEIFS('Journal Input'!$AO$4:$AO$480,'Journal Input'!$O$4:$O$480,">="&F10,'Journal Input'!$O$4:$O$480,"<="&EOMONTH(F10,0)),"N/A")
This formula works but I need multiple average ranges added to this equation. My first average data range is AO but I have others in different columns (BB, BM, etc.) I would like to average along w/ AO. My multiple criteria's cover the beginning and end of the month F10. Perhaps an array is necessary? Any help is appreciated. Thanks Mike Link to picture example here
Here's a couple options. Enter this as an array formula (Ctrl+Shift+Enter):
=IFERROR(AVERAGE(IF(('Journal Input'!$O$4:$O$480>=F10)*('Journal Input'!$O$4:$O$480<=EOMONTH(F10,0)),CHOOSE({1,2,3},'Journal Input'!$AO$4:$AO$480,'Journal Input'!$BB$4:$BB$480,'Journal Input'!$BM$4:$BM$480))),"N/A")
Or, since it's the same conditions for all columns, you can average the AVERAGEIFS of each column (this doesn't need to be entered as an array formula):
=IFERROR(AVERAGE(AVERAGEIFS('Journal Input'!$AO$4:$AO$480,'Journal Input'!$O$4:$O$480,">="&F10,'Journal Input'!$O$4:$O$480,"<="&EOMONTH(F10,0)),AVERAGEIFS('Journal Input'!$BB$4:$BB$480,'Journal Input'!$O$4:$O$480,">="&F10,'Journal Input'!$O$4:$O$480,"<="&EOMONTH(F10,0)),AVERAGEIFS('Journal Input'!$BM$4:$BM$480,'Journal Input'!$O$4:$O$480,">="&F10,'Journal Input'!$O$4:$O$480,"<="&EOMONTH(F10,0))),"N/A")

Weighted average if row header contains

I'm looking for a formula that will return the weighted average of revenue for all the products that contain a "PASSDAYONE"revenue sheet
For now, I am filtering on "PASSDAYONE" then using "sumproduct' This example returns a weighted average of 37,23. Is there a way to have this result returned in one go with a single formula?
Try the following formula:
=SUMPRODUCT((ISNUMBER(SEARCH("PASSDAYONE",A2:A9))*C2:C9*B2:B9))/SUMPRODUCT((ISNUMBER(SEARCH("PASSDAYONE",A2:A9))*B2:B9))
Above formula will first search for the string PASSDAYONE in the range A2:A9 and if found will include in SUMPRODUCT formula.

Array Formula Index Match to Select Cell Based on Second, Third, and Fourth Minimum Value

I have a cell that currently uses an array formula to return the name associated with the minimum hours worked for all my employees. However, what I am trying to do now is write an array formula that lists the three next employees with lowest hours. I have written a formula similar to this in the past, but can't seem to get the two formulas to appropriately match up.
My current return minimum employee formula in G5:
={INDEX(A:A,MATCH(MIN(IF(B:B=G3,IF(C:C>=$G$2,D:D)))&G3,D:D&B:B,0))}
Here is an example of my data:
...and now I'm attempting to incorporate in into the following array formula that would return a list of qualifying results as I dragged it down a column:
={(IF(ROWS(G$7:G7)<=F$8,INDEX($A$2:$A$8,SMALL(IF(Employees!$B$2:$B$8=$G$3,ROW($A$2:$A$8)-ROW($A$2)+1),ROWS(G$7:G7))),""))}
Currently, this array formula is only set up to match on position title and not the other qualifiers that I need from my minimum employee formula. How can I mesh the two formulas correctly? Thank you for any and all help and please, let me know if you need any clarification.
The ideal array result would show Boris and two blanks in consecutive rows in the Next 3 Employees chart.
Set your page up like this:
With the ranking in column F.
Then it is a quick modification of the last formula. Instead of MIN we use Small. The k part of the small equation is the ranking number:
=INDEX(A:A,MATCH(SMALL(IF(B:B=$G$3,IF(C:C>=$G$2,D:D)),F5)&$G$3,D:D&B:B,0))
This goes in G5. Is confirmed with ctrl-shift-enter. Then copied down for rows.
If do not want the errors to show then wrap it in IFERROR:
=IFERROR(INDEX(A:A,MATCH(SMALL(IF(B:B=$G$3,IF(C:C>=$G$2,D:D)),F5)&$G$3,D:D&B:B,0)),"NO MATCHES")

SUMIFS function having a sum range as a product of 2 ranges, Array Formulas

I'm trying to minimize creating uneccessary tables in Excel, and instead of creating a table to multiply columns A and B, can I do it within the IF formula? Perhaps using Array formulas?
I tried Ctrl + Shift + Enter to enter the following formula:
SUMIFS($A$1:$A$10*$B$1:$B$10,$C$1:$C$10,"Value")
however it did not work.
Basically, I want to sum the product of A & B (i.e A*B) if the value in C is equal to "value".
SumProduct is what you need
=SUMPRODUCT($A$1:$A$10,$B$1:$B$10,--($C$1:$C$10="Value"))
Entered as a standard (not array) formula
This formula checks if the value in Column C is equal to 4 in this example. If so, it returns the product, if not, it returns 0. You enter this formula in for example column D and drag it down.
=IF(C1=4;SUMPRODUCT(A1:B1);0)

Sum in a index/match formula

Could you help me solve the following?
I want to return the total sum, not the first match that it finds. My first preference is have indexing and matching with the sum total, if this CAN'T be done then an if statement. I have include 'sheet1!' in the formula as it will be over 2 work sheets. Below is an example of the formula, the data will be over 4000 lines.
I can't post a image as I'm new but the array formula is
=INDEX(Sheet1!$G$4:$I$10,MATCH(A2&B2,Sheet1!$G$4:$G$102&Sheet1!$H$4:$H$102,0),3)
In the data that it is matching it is return the first result of many, I what the total amount.
Try to use following formula:
=SUMIFS(Sheet1!$I$4:$I$102,Sheet1!$G$4:$G$102,A2,Sheet1!$H$4:$H$102,B2)
or
=SUMPRODUCT((Sheet1!$G$4:$G$102=A2)*(Sheet1!$H$4:$H$102=B2)*(Sheet1!$I$4:$I$102))

Resources