I have a dataset that gives the price of a security for each month for 12 years:
Month: 1 2 3 4 5 6 7 8 9 10 11 12 1 2 3 4 .....
Year: 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 2
Price: x x x x x x x x x x x x x x x x
I want to write a formula such that the average price for each quarter of the security is calculated and stored in the following table:
Quarter: 1 2 3 4 1 2 3 4
Year: 1 1 1 1 2 2 2 2
Price: y y y y y y y y
The list goes on to 40 years
What would be the simplest way of doing so without creating any additional cells?
I currently use an averageifs formula, but not sure if that is the most efficient way of doing so.
To be honest, the simplest and easy way without trying to get complicated formulas, would be transposing your data, and then Pivot Table:
TRANSPOSING: You can do this with a formula if you have Excel 2019 or higher=TRANSPOSE(A1:Y3). If not, you can copy/paste transposing:
FUNCTION TRANSPOSE
PIVOT TABLE: Your easiest shot is Pivot Table. Just set it up like this:
Year field in columns section
Month Field in rows section
Price field into values section and make sure yous et it up to calculate average instead of count or sum up
Group Month Field in groups of 3, to make quarters.
Related
Okay, as I see it now this isn't the real problem.
I need to get distinct count of customers by month, taking into account all
previous months. What I get by distinct count now is the unique count for a single month, but not taking into account the whole period. That is done by grand total but i need it segmented by month. Is there any way to fix this?
What I have now:
-2016.04 Subtotal 3
A 1
B 1
C 1
-2016.05 Subtotal 3
A 1
B 1
G 1
-Grand Total 4
What I need:
-2016.04 Subtotal 3
A 1
B 1
C 1
-2016.05 Subtotal 1
A 1
B 1
G 1
-Grand Total 4
X Y Z
1 5 0
1 4 0
1 9 1
2 5 0
2 4 0
2 **8** 1
Basically, I have an excel table with 3 variables. X is an group variable, Y is a value, and Z is a dummy variable that indicates if the Y value in that row is a total or not. Is there any way to write the conditional formatting rule so that discrepancies between SUM(Y) over the same X, and the supposed total are highlighted?
In the table above, The third row with X would not be marked because 5+4=9, so there is no discrepancy, but the 6th row would be marked because 5+4!=8, so that one should be highlighter. I appreciate your help!
Use SUMIFS();
Assuming your data starts in A1
=AND(SUMIFS($B:$B,$A:$A,$A1,$C:$C,0)<>$B1,$C1=1)
Apply it to B:B.
I have two problems here.
The data is as follows:
Col X Col Y
A 10
A 12
A
A 32
B 11
B 31
B 9
C 8
C 7
C 3
D 1
D 3
D
D 9
I need to do the following:
Count the entries in Column Y using the Categories in Column X, for ex. A repeats 4 times in Column X but has 3 total corresponding numbers in column Y, i need the 3 count of the numbers in Column Y.
Calculate the median of those numbers using the category (excluding blanks whenever there are, not to be assumed as 0 by the code), for ex. Median for A is 12, Median for D will be 3.
Please help.
So 1 is:
=COUNTIFS(X:X,"A",Y:Y,"<>")
2 is:
=MEDIAN(IF(X:X="A",IF(NOT(ISBLANK(Y:Y)),Y:Y)))
Hold down ctrl + shift when you're using 2 as it's an array formula
I would like excel to iterate through a column of precipitation values and keep adding them as long the value is larger than zero. The table for example looks like this with the required result in NewCol.
Date prec NewCol
x 10 10
x 8 18
x 3 21
x 0 0
x 1 1
x 0 0
I would like to use the value 21 (and all other values with largest values) to assess consequtive rainfall days. Wondering if this is possible in Excel? Haven't been able to find the solution in Mathlab.
Thanks in Advance!
In EXCEL sheet I have 1728 rows and 2 columns (L and O). I am doing addition of these 2 columns in column P. Further I want to count the occurrence in this column if addition is EQUAL to 2 or 4 or 6 or 8 BUT condition here is that The COUNT should be such that BOTH the columns L and O are EQUAL and Their addition is either 2 or 4 or 6 or 8.
This means that only the columns in L and O with values "1+1" , "2+2", "3+3", "4+4" should be counted. The addition of "1+3", "4+2" should not be counted.
=COUNTIF(P:P,4)
does not work.
L O P M
===========================
1 1 2 1 (NO OF 2'S)
2 2 4 1 (NO OF 4'S)
3 3 6 1 (NO OF 6'S)
1 3 4* NO TO BE COUNTED
4 4 8 1 (NO OF 8'S)
2 4 6* NOT TO BE COUNTED
4 2 6*
AS SEEN ABOVE RESULT OF COUNTING IS STORED IN M. Let me know the formula
=IF(L29=M29,SUMPRODUCT(--($L$29:$L$35=$M$29:$M$35)*(L29=$L$29:$L$35)),"Not Counted")
My data started in row 29 so you will need to adjust the references. It counts the entire table in 1 shot. So if you added a row to the bottom that had 1 and 1 and 2, the results in column M in your first row would become 2 and the same for the row you just added.
Will this formula help...?
=IF(AND(A1=B1,OR(SUM(A1,B1)=2,SUM(A1,B1)=4,SUM(A1,B1)=6,SUM(A1,B1)=8)),SUM(A1,B1),"NOT TO BE COUNTED")
Just drag the formula till you have data. You will need to adjust the references.
Here is the reference data.