I am looking to calculate values across multiple sheets - pulling multiple values.
Example:
If anything in column D on page 2 equals (a list of variables) then calculate the value of column B for the rows in that column that match the suggested variables on page 1.
Thanks!!
Try this:
=SUMPRODUCT((COUNTIF($A$4:$A$8,Sheet2!$D$2:$D$31)>0)*Sheet2!$B$2:$B$31)
$A$4:$A$8 would be where you have the list of values.
Related
How can the product of 2 columns be calculated with a dynamic array solution such that the resulting array automatically resizes for the respective lengths of the 2 input columns?
For example, suppose there are 2 columns (col A and B), and a 3rd column for returning the product of those columns A and B. What I am looking for is a dynamic solution that automatically extends whenever new values are entered into both columns A and B and shows the resulting product of all values row by row.
I want to avoid using macros or dragging of cells for extension of the calculation.
What I have tried is adding the function =PRODUCT(A1,B1) but that does not automatically extend I have to drag the cell down the column.
My spreadsheet has a list of names (some are repeated) in column A, a list of numbers stored in a string in column B, and column C uses a formula to get the first number of the string in column B. In column E have created a list of the unique names from column A, in column F a number of times they appear in the data list and in column G i then want to fetch the corresponding number data from column C each time it appears in the list to calculate average numbers.
I have tried this
=SUMPRODUCT(($A$1:INDEX($A:$A,COUNTA($A:$A))=$E4)*($C$2:INDEX($C:$C,COUNTA($C:$C))))/$F4
The problem i have is that in the list of data some of the cells in column C are blank so i am getting a #VALUE error.
Here is a screenshot of what i am trying:
Is there anyway to tell SUMPRODUCT to skip the rows where there is no number data?
Obviously this is just an example and my actual spreadsheet is a little more complicated, there are thousands of rows of data and the names are repeated many times over.
Empty cells are not your problem. It would just be accepted in a formula like yours. Unfortunately the problem is because you have gaps, COUNTA will return a range that's not equal to column A > COUNTA in column A will return 15, whereas COUNTA in column C will return 11. Unequal ranges will return #VALUE
In this specific case your issue is resolved through:
=SUMPRODUCT(($A$1:INDEX($A:$A,COUNTA($A:$A))=$E4)*($C$1:INDEX($C:$C,COUNTA($A:$A))))/$F4
In G4, copied down :
=SUMIF($A:$A,$E4,$C:$C)/$F4
Edit : SUMIF() can use whole column reference of which bounded on used range only, and can avoid to use dynamic range.
I need to sum all values in Column A where Column B is a duplicate.
Above is a sample of the data. Column B has urls and Column A has counts for the urls. What I want is to sum the values in Column A for duplicate values in Column B.
Example:
The output for _.apelabs.net should be 6.
How can I achieve this?
I think you are looking for the function =COUNTIF(Range,Criteria)
Here is a link that shows a usage example.
As #Andresson stated, if you're trying to count the number of times a specific url appears, you might want to use the COUNTIF function: =COUNTIF(range, criteria).
COUNTIF Example:
Using =COUNTIF(B:B, "_.apelabs.net")
would return 3 in your sample data (assuming your image includes the only instances of "_.apelabs.net").
This example of the COUNTIF function is the same as saying, "count the total number of times a cell in Column B (i.e. B:B) equals "_.apelabs.net"."
However, if you're wanting to sum together all the values in Column A where the corresponding url in Column B matches the given criteria, you'll want the SUMIF function: =SUMIF(range, criteria, [sum_range]).
SUMIF Example:
Using =SUMIF(B:B, "_.apelabs.net", A:A)
would return 5 in your sample data (again assuming your image includes the only instances of "_.apelabs.net").
This example of the SUMIF function is the same as saying, "each time a cell in Column B (i.e. B:B) equals "_.apelabs.net", sum together the values in Column A (i.e. A:A) that are located in the same row as each "_.apelabs.net" found in Column B."
Additionally, you can also use a pivot table, as #ScottCraner suggested. It's all a matter in how you want to present your findings.
I have the following data in excel / google spreadsheet,column A contains values separated by a, and this column will be updated everyday with new data. Column B shows the sum for all values separated by a's. For instance, there are two values between the 1st a and 2nd a, therefore the sum for these two = 2+2=4. There are three values between the 2nd a and the 3rd a, therefore the sum for these three = 3+2+4=9.
I am just wondering if I could write a function in column B to automatically detect where a is and then do the sum for all future data. It's like doing the loop thing in programming.
Any advice would be greatly appreciated.
Assuming you never have more than 100 rows of numbers between "a" the following formula works =IF(A9="a",SUM(OFFSET(A10,0,0,IFERROR(MATCH("a",A10:A107,0),100)-1,1)),"")` in cell B3
I have a set of data with multiple columns. I'm trying to transfer the data from columns to rows, but only for the unique members.
For instance, I would like the "Hours Worked" to populate under the correct month in the rows to the right based on unique "SSN"
I've tried =IF($P2=$C2,HLOOKUP(Q$1,$H:$H,MATCH(Q$1,$H:$H,0),FALSE),"")
Index/Match, etc but can't figure it out.
https://docs.google.com/spreadsheets/d/13jJJ0GXb6hFW7YEyyqrCn8cfotUeFurtm0U1EFj_kPY/edit?usp=sharing
Try the following formula in cell F2 and copy it over:
=SUMPRODUCT(--($E2=$A$2:$A$13),--(F$1=$C$2:$C$13),$B$2:$B$13)
The result of ($E2=$A$2:$A$13) is an array containing trues and falses, depending on whether the ID in column E is equal to the ID in column A. (F$1=$C$2:$C$13)does the same thing for the date. By adding -- in front of these arrays, we convert the trues and falses to ones and zeros, respectively. The third array contains the hours worked in each month. These three arrays are then multiplied (and summed up in case there were several entries for one ID in one month).