Sumproduct In Vba (formula Array)

May 6, 2009

I have a function that has a formula sumproduct and here it is:

Set RSheet = Worksheets("Rawdata")
Set RSheet = Worksheets("Rawdata")

RSheet_lastRow = RSheet.Cells(Rows.Count, "A").End(xlUp).Row
RSheet.Range("AJ2:AJ" & RSheet_lastRow).Formulaarray = "=SUMPRODUCT
((V2>=ProjectedStarts!\$K\$1:\$K\$45)*(V2<=ProjectedStarts!\$L\$1:\$L\$45),ProjectedStarts!\$M\$1:\$M\$45)"

The problem is that when the formula is sent to each cell V2 (bolded) does not change to V3, V4, V5.

Conditional Sumproduct Array Formula

Nov 1, 2013

I need to sum several non-contiguous columns if certain other columns meet a certain criterion.

Details:

Need to sum columns Q,R,S,T,U,V,W,X,Y,Z,AC,AD,AI,AJ,AK,AL,AM,AN,AP,AQ,AR,AS,AT,AU,AV,AX,AY,AZ,BA,BC,BD,BE,BF,BH,BI,BK,BL,BM,BN,BQ,BR
in sheet "(1) 65539004 SAP"

IF

column D in sheet "(1) 65539004 SAP" = A2 in sheet "(4) Brand Breakout" AND column L in "(1) 65539004 SAP" = \$B\$1 in "(4) Brand Breakout"

The formula will be placed in C2 in "(4) Brand Breakout" and copied to other cells just FYI,

Array Formual Or Possible A Sumproduct Formula

Sep 9, 2008

I think I need an array formula or possible a sumproduct formula, to make this work

=SUMIF(\$BU\$36:\$BU\$66,"X",T\$36:T\$66)

Column BU is a column that gets an X auto added to it each day, the date field runs down my spreadsheet from row 36 to 66. I use the X as month to date signifier so each day before todays date has an X in column BU. The formula above will then take whatever is in column T and adds up only the figures enter against the date before todays date.

This method works for most of my fields but column T is an average so I can't just add up the averages.

Column T is Average Handle Time, to work out the AHT for the month I presume I need some sort of array formula that also looks at the number of multiples the AHT by calls handled each day then divide the total minutes month to date by the total calls handled. How do I fit in an array formula that only works for the days when column BU has an X in it.

The calls handled field is column P

I've tried this but it doesn't work as a formula (the sumproduct part works outside of the sum if part).
=SUMIF(\$BU\$36:\$BU\$66,"X",SUMPRODUCT(\$P\$36:\$P\$42,\$T\$36:\$T\$42))

Single Cell Array Or Sumproduct Formula

Jun 16, 2009

To calculate the result for a month is easy, but I can't figure how to get a single cell formula to calculate for the year. The sample attached explains it better.

Sumproduct And Sum Array Formula (calculate The Salary Payments To Temporary Employees In A Particular Work Unit)

Jul 16, 2009

I have a spreadsheet representing a month where I am trying to figure out different scenarios for employees. One scenario is that an employee could have to move to a temporary position. In that case, I need to calculate the salary payments to temporary employees in a particular work unit. I've tried several different approaches to this problem, but am still getting the error.

One method has been using this sumproduct formula:

Sumproduct On Array

Sep 9, 2009

There is a date field and three "attempt" fields.
If The first attempt was a fail and the second a pass this must count as a pass and not a fail. If the first attempt was a fail and second was a fail then this must count as a fail, same again for third column.

On the totals tab there should be a total against each date for the fails. As you can see iv tried doing by sumproduct but its not working, i understand why its not working but i just can't see how I can get it right.

Populate Using SUMPRODUCT Or ARRAY

Apr 3, 2009

formula to take data from a column entry to a row style? I've attached a sample spreadsheet.

Sumproduct Excluding An Array

Dec 16, 2009

I have the the following formula =SUMPRODUCT(--(dealer1=\$B36),--(make=\$A36),--(company<>nominated))

The first two statements work alone, however I have an array which contains a list of customers that I wish to exclude from the total. I've put those in an array and called it nominated, However I just get #N/A.

Array In SUMPRODUCT = NOTBLANK

Nov 14, 2008

I need to finish a final bit of tweaking in the following formula..

=SUMPRODUCT(--('[MRP Data File.xls]ZMM_CHECK_MRP_AREA'!\$A\$1:\$A\$10000=A9),--('[MRP Data File.xls]ZMM_CHECK_MRP_AREA'!\$D\$1:\$D\$10000="15BG"),--('[MRP Data File.xls]ZMM_CHECK_MRP_AREA'!\$I\$1:\$I\$10000""),'[MRP Data File.xls]ZMM_CHECK_MRP_AREA'!\$R\$1:\$R\$10000)

What I'm trying to achieve is to return the value of the cell in column R if column A=A9, D="15BG", this part is fine so far but I only want to return the value if column I = NOTBLANK

At the moment the value is returning whether it is blank or not...

For info: column I will only contain "CLC", "CLR" or totally blank

SUMPRODUCT Array Reference Causing #N/A

May 27, 2009

Using Excel 2003, I'm summarizing info in one sheet (Review) with data in another worksheet (Work Orders). The following SUMPRODUCT calc worked fine...

Whole Column Range In A Sumproduct Array

Jul 29, 2009

I've created a spreadsheet with SUMPRODUCT formulae, which is working fine for now.

However, these formulae include arrays with ranges of, for example, \$G\$2:\$G\$600. What we need to do is, instead, reference the while column as far down as it goes, forever as the range of the array. This applies to multiple occurrences.

Every formula I have found for this may work on of itself, but does not work with the SUMPRODUCT formulae I have used.

For reference, an example:

=SUMPRODUCT(--('BG NEW DB'!\$D\$2:\$D\$600=\$B\$2),--('BG NEW DB'!\$G\$2:\$G\$600=C\$2),--('BG NEW DB'!\$H\$2:\$H\$600=\$A\$2),--('BG NEW DB'!\$AD\$2:\$AD\$600="Y"))

Sumproduct Of 2 Criteria In A Single Array

Jul 16, 2007

I want to use Sumproduct function to sum up the values that belong only to Product "PXT" and "PCT". I enter it as array but my formulae doesnt work. can someone give me a hand. Here is my formulae: =SUMPRODUCT((C2:C10="PXT")*(C2:C10="PCT"))*(A2:A10)

ABCD
1ValueQtyProduct
2299.944PXT
3186.53PXT
4711.071PCA
5561.862PCT
6608.961PXT
7520.026PCT
8427.682PCA
9397.341PCA
10387.664PCT

Using Multiple Sum Ranges In Sumproduct() & Countif() In Array

Jul 2, 2009

My problem is :

1.In G Column I put logic for Fail and Obtained Marks.

G2=IF(COUNTIF(B2:F2,">=60")=5,SUM(B2:F2),"Fail")

2. Now in H column I want use this formula which I obtained from this forum

H2=SUMPRODUCT((G\$2:G\$7>G2)/COUNTIF(G\$2:G\$7,G\$2:G\$7&""))+1

To get the position of Students.

But the text value "fail" in the G2:G7 getting Position No. 1 and i've noticed the reason by using evaluate formula as well.

3. I got solution by changing "Fail" with 0 by creating column I and then column H put this formula ........

Array To Match Several Results Within SUMPRODUCT Function

Aug 25, 2008

I'm using a formula (with the SUMPRODUCT function) within which I need to match the month & year from an array with 3 "true" possibilities...

Meaning that if data (month & year) from the array matches any of the 3 months & year of a specific quarter (for example July 08, August 08, September 08), the result of that section should be "True".

The data to be matched (any of the 3 months of each quarter) is drawn from a table header (showing every month of the year) by using this "monthly" formula:

TEXT(H7;"mm.yyyy") where H7 holds "01.07.2008" (but displays "Jul. 08") and returns "07.2008".

I'm trying to extend it to something like:

TEXT({H\$7;I\$7;J\$7};"mm.yyyy") to match either July 2008 (H7), August 2008 (I7) or September 2008 (J7) for the 3rd quarter of 2008 but when I hit Enter, I get an error and H\$7 is highlighted ("ctrl + shift + enter" doesn't help).

Here's an excerpt of the formula that works well for other queries on my worksheet:

=SUMPRODUCT(--(TEXT('Current update analysis'!\$O\$2:OFFSET('Current update analysis'!\$O\$2;(COUNTA('Current update analysis'!\$B:\$B)+20);"mm.yyyy")=TEXT({H\$7;I\$7;J\$7};"mm.yyyy")); --('Current update analysis'!\$k\$2:OFFSET('Current update analysis'!\$k\$2;(COUNTA('Current update analysis'!\$B:\$B)+20)="ok"))

how I could/should structure the formula for it to work?

Using Multipel Sum Ranges In Sumproduct() & Countif In Array

Jul 6, 2009

I want to get students positions in a class like 1st, 2nd, 3rd, etc. There can be two 1st position and 2 2nd positions at a time .

1.In G Column I put logic for Fail and Obtained Marks.
G2=IF(COUNTIF(B2:F2,">=60")=5,SUM(B2:F2),"Fail")
2. Then i made array formula in column H to get the position
={SUMPRODUCT((IF(ISNUMBER(\$G\$2:\$G\$7),\$G\$2:\$G\$7,0)>N(G2))/COUNTIF(G\$2:G\$7,G\$2:G\$7&""))+1}
Some improvement to write fail & position
={IF(COUNTIF(B3:F3,">=60")5,"Fail",SUMPRODUCT((IF(ISNUMBER(\$G\$2:\$G\$7),\$G\$2:\$G\$7,0)>N(G3))/COUNTIF(G\$2:G\$7,G\$2:G\$7&""))+1)}
And more work to get total marks & position and Fail at the same time......
={IF(COUNTIF(B2:F2,">=60")5,"Fail",SUM(B2:F2)&"-"&SUMPRODUCT((IF(ISNUMBER(\$G\$2:\$G\$7),\$G\$2:\$G\$7,0)>N(G2))/COUNTIF(G\$2:G\$7,G\$2:G\$7&""))+1)}
Now I wounder that is there a way to do all calculations in column H without using column G

By replacing (if there is any method) G2, G3, G4 etc. with Sum(B2:F2); Sum(B3:F3);Sum(B4:F4) etc. in below formula
={SUMPRODUCT((IF(ISNUMBER(\$G\$2:\$G\$7),\$G\$2:\$G\$7,0)>N(G2))/COUNTIF(G\$2:G\$7,G\$2:G\$7&""))+1}.....................

Only Include Month Of January In Sumproduct Function On Another Page Using Array

Dec 27, 2013

I only want to include the Month of January in a sumproduct function on another page using a name manager array.

I was thinking of using

=SUMPRODUCT(INDEX(DATA,0,17),--((MONTH(INDEX(DATA,0,5)=1)*INDEX(DATA,0,17))

Where the dates are in the 6th column and include blank cells at the bottom and in the first row it says Date.

Efficient Implementation Of SEARCH Outside And Or Inside An Array/SUMPRODUCT (2007)

Jan 24, 2010

I need to check each of 13,000 job titles to see if they include the string "VP".

For the time being, I want to find the most efficient way to check an individual title, before building an array or SUMPRODUCT function that will check all the titles in swoop.

So... I have tried:

=ISNUMBER(SEARCH(A1,B1))

..but it returns TRUE if A1 and B1 are both blank -- which they can be in my spreadsheet.

And I have tried:

=SIGN(SEARCH(A1,B1))

but it returns #N/A if A1 cannot be found within B1.

If I can, I want to avoid introducing an IF statement because, looking ahead, I am already concerned that this analysis will be complicated enough without multiple paths.

So.. what's the most efficient way to return a TRUE/FALSE, or 1/0, result depending on whether A1 is in B1?

EXTRA-CREDIT!

An extension of the above problem... arrays and SUMPRODUCTs welcome:

What's the most efficient way to return a TRUE/FALSE, or 1/0, result depending on whether (A1 or A2 or A3... or A99) is in B1?

Large SumProduct Array -- Original Title:Loop Function

Dec 19, 2007

could provide me a loop function in VBA for these calcultions.

Cell A1*E1 + B1*F1 + C1*G1
Cell A2*E1 + B2*F1 + C2*G1
......till
CellA100*E1 + B100*F1 + C100 * G1

These are the calculations for E1-G1.
The process must be repeated till E50-G50

So the second step is:
Cell A1*E2 + B1*F2 + C1*G2
Cell A2*E2 + B2*F2 + C2*G2
......till
CellA100*E2 + B100*F2 + C100 * G2

Sumifs Or Sumproduct Or Array Pull Result From Range Of Columns

Oct 3, 2013

I'm trying to pull thesum of huge number of columns in this case the range of pulling the data is B2:E7 based on two criteria (B8 and B9) The result is on B11

Sheet1

*
A
B
C

[Code].....

Database Functions Vs. Array Formulas Vs. SUMPRODUCT Vs. Pivot Tables

Dec 13, 2006

All I am doing is counting text values in a table.

The table has 3 main columns(which are relevant to this thread anyway).

Shift - Area - Status

The example I have attached shows examples of DCOUNTA, SUMPRODUCT and a Pivot Table.

I have read many threads stating that the best one to use is Pivot Table followed by DCOUNTA followed by SUMPRODUCT.

The most effective for me seems to be SUMPRODUCT (although this does slow excel down dramatically when you use a lot of these formulas). As do Array Formulas

The Pivot Table does not update on its own, therefore constantly needs to be refreshed. (I could use code to do this)

The DCOUNTA seems to be the least effective at doing what I want (unless I am doing something wrong)

In the attached example can the DCOUNTA be used more efficiently as I don't like the fact that I am duplicating rows to apply the criteria for a different shift. e.g

Area 1 - Late Shift - Banned
Area 1 - Early Shift - Banned

I want my table to be as follows (as the SUMPRODUCT shows)

AREA - Early Shift - Late Shift - Night Shift - Area Total
Area 1
Area 2
Area 3
Area 4
Area 5

Shift Total

Incorrect Sumproduct Array: Sum Up The Total Number Of Hours Consumed On A Particular Activity Within A Specified Period

Oct 23, 2009

I am trying to sum up the total number of hours consumed on a particular activity within a specified period.

=SUMPRODUCT((\$C38:\$C176>=\$B7)*(\$C38:\$C176<=\$C7)*(\$B38:\$B176=\$D5))

Unfortunately, the formula above gives me the total number of activity and NOT the total number of hours within a specified period. I attached the file I'm working on as reference.

Converting 3x10 Array To A 1X30 Array To Run A Match Formula

Apr 7, 2009

Say I have 3 columns of data: A1:C10 and I want to run a Match() function on them all together to see if I get a match any one those cells, say the value of have in X1.

Since, Match only allows a One-Column lookup array.. is there a way to "concatenate" or "append" the 3 columns together within a formula so now I would be looking to Match in an array that is 1 column * 30 rows?

Basically want to convert =Match(X1,A1:C10,0) to =Match(X1,A1:A30,0) without moving around the raw data in the sheet.

And I want to avoid doing an AND or OR formula that uses 3 separate MATCH() for each column.

I have a hunch that the MMULT or MMULT/TRANSPOSE functions are involved, but can't seem to get it right.

Index Match Array New Formula Not Array?

Nov 6, 2013

Is there anyway to recreate this formula w/o it being an array ?

{=IF(C3="","",IFERROR(INDEX('Master List'!\$B\$1:\$B\$2000,MATCH(TRUE,ISNUMBER(SEARCH('Master List'!\$A\$1:\$A\$2000,C3)),0)),"ADD TO MASTER"))}

Concatenate An Array (using Array Formula)

May 18, 2007

I just wanted to concatenate a few cells using an array formula like this:

{=SUM(IF(B2:J2="";0;B2:J2))}

Well, this does not work. I have no idea why it fails. Any solution to this without scripting?

Using Array Variable Instead Of Array Formula

Jun 30, 2006

i need to replicate what i did using array formulas with VBA macro (array variable). to make things clear and simple i created an example for illustration only. look at it & u will find what i did & what i need to do ,much of it
in writing so that i accurately describe my problem. attached is my example

IF Formula In SUMPRODUCT

Dec 9, 2009

I'm trying to write a SUMPRODUCT formula (cell H2 in the attachment) that gives different outputs according to the value of another cell (H1), but the output values are incorrect. I suppose it's because the "else" value given in the IF formula won't be recognized as a formula but as a text.

SUMPRODUCT / AND Formula

Jul 11, 2007

I'm currently using a series of SUMPRODUCT formulas to populate a summary page from a large data source. This works fine in the most part, however one part of the summary page calls for a number of different criteria to be counted within the same data range. I'm currently using a work around by having three seperate SUMPRODUCT formulas on hidden rows, and then totaling their answers to give me the result I want, however I wondered if there was a cleaner and better way to do this? An exampel of the formula I am currently working with is below:

=SUMPRODUCT(('Filtered Data'!\$A\$2:\$A\$10000="Stock-Out")*('Filtered Data'!\$I\$2:\$I\$10000="Open")*('Filtered Data'!\$Q\$2:\$Q\$10000="A"))

The final part of the formula is what is causing me the problem - I would like it to look for and count occurances of "A" , "B" , & "C"

Sumproduct Formula - #Value! Returned

Jan 29, 2009

I've got a workbook where sheet "Raw Data" is used to enter audit findings. Subsequent sheet "Analysis" contains formulas to extract quantities and nature of audit findings so that they can be shown on quarterly reports.

When I set up the workbook the formulas on the "Analysis" sheet worked fine. The department has filled the columns with data and now all the formulas are returning #Value! There's something fishy going on here.....

=SUMPRODUCT(--('Raw Data'!\$H\$7:\$H\$1000=A4),--('Raw Data'!\$K\$7:\$K\$1000=C\$1))

=SUMPRODUCT Formula Failure

Feb 24, 2009

No doubt due to a fundamental lack of understanding my SUMPRODUCT formulae (please see attached workbook) is not working.

Can someone be kind enough to point out the error of my ways? I've tried every possible combination (except the right one).

Sumproduct Or Sumif Formula

Aug 24, 2009

a1=good
a2 = 100

b2 = 50

c1 = good
c2 = 100

would like to sum a2+b2+c2 only if a1,b1,c1 = good.