I need to sum the data points (vlookup points) in above cells for a variable number of data rows. Each sum location is separated by a blank row in the report. I am getting an error in the Index portion of the formula to complete the sum.
The sum should be for all data points above when there is a data point in column C directly to the right. Is there an adjustment I need to make to the sum function or do I have the sum approach all wrong?
The third fourth and fifth data series have the sum manually entered to show what I need. Please let me know if you need any more information. Thanks for your help!
"=IFERROR(IF(C3<>"",SUM(B1:INDEX(B:B,MATCH(TRUE,INDEX(B2:$I$998="",0),0))),VLOOKUP(A3,'[179821 Invoice Status Report.xls]Subcontract Invoices'!$A$8:$AB$506,4,FALSE)),"")"
Sum Above Example
The range in your INDEX needs to be a single column. So if you change $I$998 to $B$998 it should work.
Related
=countif(E2:E21*E23:E37*I2:I20*I22:I37,VLOOKUP(C3, C2:C21*C23:C37*K2:K20*K22:K37,1,0))
I am trying to use the formula above to do the following: I need to calculate the sum of all non empty cells in the login columns on all the ranges in the sheet that have station type ARSAW. I know all of them are empty right now but I'm speaking of when they are not empty.
I have a table in which multiple weeks of data is stored and I'm trying to return a value based on 2 criteria.
Column A of the data sheet contains the date the report was ran (Always on the same day of the week - 24/05/17, 31/05/17 etc)
I've managed to return the value of column H by using an array formula, based on a cell value (Date) in ''Issues Data Quality Overview'!$B$4' using the following formula:
{=IFERROR(INDEX('Issues Log'!$H$1:$H$20000,SMALL(IF('Issues Data Quality Overview'!$B$4='Issues Log'!$A$1:$A$20000,ROW('Issues Log'!$A$1:$A$20000)-MIN(ROW('Issues Log'!$A$1:$A$20000))+1,""), ROW(A2))),"")}
That returns a value such as "IID-10225-22".
Problem:
Now I need to look up that value in the same table, based on a date in another cell, and return column X. (essentially adding the returned value as a criteria).
In all honesty I'm lost as to how I'd do this.
#Matthew. I understand your formula gives the list of values in column H with column A values matching 'Issues Data Quality Overview'!$B$4 in an ordered list.
Does your Issues Log, column H have multiple occurrence of the same value? (example: IID-10255-22 can have a value in Issues Log, column A that is not the same value as 'Issues Data Quality Overview'!$B$4).
If not, it doesn't make sense to use the result as a lookup value to get column X, you can simply change the code to:
{=IFERROR(INDEX('Issues Log'!$X$1:$X$20000,...}
If it does have multiple occurrences and you want to get the first occurrence of the result in column H and get the value in column X, best to add a formula right next to your array formula and do a VLOOKUP.
I've scrapped the array formula, as it really slowed down the processing speed. Instead I've created a Unique ID (=IssueID&Date) and VLookup'd that.
I have a spreadsheet that looks like this:
The data is in the coloured section, to the right of that is a table that shows the average of the result column when the data under ABC, XYZ, or GGG is inbetween the Max and Min Value.
This was done with this formula: =AVERAGEIFS($D$4:$D$27,A$4:A$27,"<"&$F5,A$4:A$27,">"&$G5)
What I want to do is have that formula reference the heading and then lookup the appropriate column in the data table to apply the averageif criteria to.
The formula I have now works fine but as I add more columns and the data table that may be out of order it would be much better if I was able to incorporate a lookup or match into the averageifs formula.
The following non-volatile function will do it:
=SUMPRODUCT(($A$1:$C$1=H$1)*($A$2:$C$21>=$G2)*($A$2:$C$21<=$F2)*($A$2:$C$21))/SUMPRODUCT(($A$1:$C$1=H$1)*($A$2:$C$21>=$G2)*($A$2:$C$21<=$F2))
EDIT
To get the average of the results column when the other column is within the constraints. Change the fourth Criterion in the first SUMPRODUCT():
=SUMPRODUCT(($A$1:$C$1=H$1)*($A$2:$C$21>=$G2)*($A$2:$C$21<=$F2)*($D$2:$D$21))/SUMPRODUCT(($A$1:$C$1=H$1)*($A$2:$C$21>=$G2)*($A$2:$C$21<=$F2))
EDIT2
Another option that is both non volatile and non array:
=AVERAGEIFS(D:D,INDEX(A:C,0,MATCH(H$1,1:1,0)),">=" & G4,INDEX(A:C,0,MATCH(H$1,1:1,0)),"<=" &F4)
if you are doing it over a small number of calcs then the Offset function will work for you replace your reference to your current A column with
OFFSET($A$4,0,MATCH(h$2,$a$2:$d$2,0))-1,24,1)
The offset is broken down in to $A$4 being your reference point.
The 0 being how many rows to move from the reference point to start
The MATCH(h$2,$a$2:$d$2,0))-1 being how many columns to move from the reference point
The 24 is the number of rows to return
The 1 is how many columns to return
The match formula looks for the value in H2 in your header road in A2:D2 for an exact match and returns the number for the spot the item was found. We subtract 1 from this result as we only want to move one less spot than where the item was found. So it if was found in the 1st spot we dont want to move over any columns so we need to make the value 0.
You end formula would look something like:
=AVERAGEIFS($D$4:$D$27,OFFSET($A$4,0,MATCH(h$2,$a$2:$d$2,0))-1,24,1),"<"&$F5,OFFSET($A$4,0,MATCH(h$2,$a$2:$d$2,0))-1,24,1),">"&$G5)
I want to SUM everything above a cell that contains the word "SUMTOTAL". So if I have 50 columns I want it to go to first row that has the text "SUMTOTAL" in it and then Sum everything aboce that word. Is it possible?
Use a MATCH formula to find the row and minus one from it then use an INDIRECT formula to put together a string of the address then plop it into a sum formula like this:
=SUM(INDIRECT("A1:A" & MATCH("SUMTOTAL",B:B,0)-1))
Assumption:
SUMTOTAL is in column B somewhere
The numbers you want to sum are in column A
Your data starts at row 1.
You are summing ONE column. To expand simply change "A1:A" to "A1:X" if you wanted to sum columns A to X
I assume that all your data is located in A1:N20, and SUMTOTAL appears somewhere inside this area (you can easily change the desired data location). The following formula does the summation of all numbers directly above SUMTOTAL, i.e., in the same column.
=SUM(OFFSET($A$1,0,SUMPRODUCT(COLUMN($A$1:$N$20)*($A$1:$N$20="SUMTOTAL"))-1,SUMPRODUCT(ROW($A$1:$N$20)*($A$1:$N$20="SUMTOTAL"))-1))
If you want to sum all numbers above SUMTOTAL, no matter if in the same column or not, use
=SUM(OFFSET($A$1,0,0,SUMPRODUCT(ROW($A$1:$N$20)*($A$1:$N$20="SUMTOTAL"))-1,COLUMNS($A$1:$N$20)))
=SUM(INDIRECT(ADDRESS(1,COLUMN())&":"&ADDRESS(ROW()-1,COLUMN())))
I'm trying to create a simple tracker. In columns B and C, tasks are tagged with an author, and then the author fills in a completion date.
Above is a dashboard that counts items for easy viewing. I countif for the total, but have not been able write a formula for the complete column. I've tried countifs, but haven't been able to get the formula to work.
Thoughts?
Try below formula as per attached
OUTPUT
Using DSUM will probably send you in the right direction.
http://office.microsoft.com/en-gb/excel-help/dsum-HP005209069.aspx
From what I see in your image, you should do a Pivot table for your dashboard.
If you absoluteley have to (???) get along without a Pivot table, do the following:
start the dashboard in column B, so that column A just contains column header "Tasks" and data (no blank rows allowed!)
count the number of tasks as =COUNTA(A:A)-1 (-1 for the header)
count all other columns as =COUNTA(OFFSET(B5;0;0;$E$2;1)) (in this example you count column B, header is in B4, first data therefore in in B5, number in tasks from above formula in $E$2)
The Offset function basically gives back a range starting relative to a reference and being of chooseable size. So we start it at the first data cell and make it 1 column wide, and #oftasks rows deep
With COUNTIFS, assuming VH is in A8, Tasks/Author/Completed are in Row12 and you have or might have data up to Row1000:
=COUNTIFS(B$12:B$1000,A8,C$12:C$1000,">1")
copied down as required.
You can use SUMPRODUCT to find the amount completed per author.
=SUMPRODUCT(--($B$8:$B$16=A3),--($C$8:$C$16>1))
In this case, the "--" tells SUMPRODUCT to treat each cell in the array (I used the example by User2063626) individually so it starts at the beginning and checks if B8=VH and records the answer as a boolean (1 for TRUE or 0 for FALSE), in this case it does equal VH so it uses a 1. Then it checks to see if C8>1 (it will be if there is a date) and stores a 1. It then multiplies the two values together 1*1=1 to give you a value for the first row. It then moves on and does the check for B9 (gets a 1 because it is equal to VH) and C9 (gets a 0 because there is no date), multiplies the row result 1*0=0 and adds it to the previous result. It repeats for each row in the array and returns the count of rows where the author was VH AND there is a completed date (2).