I need to calculate the average from the percentages shown in the picture below but I need to ignore the 0s.
So, I need the average of the first row of percentages, precisely cells H1, K1 and N1, but because K1 is a 0 I will not include it. So the first average is 100%.
I know about averageif but I cant make it work, and I do not think it would in this case
=IFERROR((H1+K1+N1)/((H1>0)+(K1>0)+(N1>0)),0)
Related
In excel, I need to calculate average in column B for every few data thats in Column A but need to skip total. But column A doesnt have a consistent sequence. Is it possible to do sth like the picture? I have 100k+ records so doing it manually is not very efficient. Please advise if there a way doing it, thanks
The logic is that First Average number is based on B2:B6, second average is B8:B11 that is skipping all the "total"
Use INDEX/MATCH
=IF(OR(A1="TOTAL",ROW()=2),AVERAGE(B2:INDEX(B2:B$1040000,MATCH("TOTAL",A2:A$1040000,0)-1)),"")
Put that in C2 and copy down the dataset.
I have a sheet which keeps track of football matches and their scores. Is there a way to tally the results of a formula in the same cell the formula is in?
Column K shows total number of goals scored. I'd like column T to keep track of how many times there were more than 2.5 goals in a match. The formula to check if there are more is no problem, =IF(K2>2,1,0) Doing it this way simply gives 0 or 1 all the way down column T. What I am after is as the results are pasted into column K, that corresponding cell in T is tallied, either adding 1 or 0 to the previous cell. So instead of 1s and 0s all the way down, it is counting how many times it was >2. I want this to happen dynamically, so the tally updates as the results are input
Is this possible at all, either using conditional formatting or VBA?
You can use Countifs() function like-
=COUNTIF($A$2:$A2,">="&2.5)
I want to be able to SUM one column and SUM another column and display one over the other, for example.
=SUM(A:A) / SUM(B:B)
But for it not to be divided.
This is to calculate actual profit made out of potential profit i could have made.
Thanks!!
I need to calculate the average value of a column contain temperature values (column H). The difficult part is that I want to average only specific cells of this column, that meet certain criteria. More specifically, I want to average temperature values from column H, only if the wind direction is northwest,which is detoned as "NW", the values of which are in column J, as well as if the wind speed is lower than 2 (column D). I used the AVERAGEIFS command but I recieve a message that "excel the formula you typed contains an error".
AVERAGEIFS($J$3:$J$5434;"NW";$H$3:$H$5434;D3:D5434;"<2")
Is the averageifs not the proper command to calculate this? Do you have any other ideas on how I could do it?
=AVERAGEIFS(H3:H5434;J3:J5434;"NW";D3:D5434;"<2")
should work, where the main difference is that the column to be averaged comes first. Since there seems no need to copy this formula around the $s seem redundant.
I have problem with dynamically average calcuation.
...after adding (I change Average manually)
In my Excel file I have users with some values and I'm every month adding new values and there is also Average that must increase. Now I edit this manually but I want to do that automatically. Is it possible? How should be the formula for this?
Note that I cannot move cells.
First of all move the column with the average to a place where you don't need to move it anymore. Probably P column if you need to get all months in there.
Then in the P2 cell add this formula
=SUM(D2:O2)/COUNT(D2:O2)
This will first sum the range and then divide by the number of entries you have in the range.
However, this part: also Average that must increase is nothing that a formula can handle.
It will only calculate the average, sometimes it may increase and sometimes it will decrease.
As stated above, you should move the average calculation else where.
Another approach is to create a named ranges.
For John, we will use following formula for named range definition and call it JohnAvg, this is generic formula for dynamic range, it will expand for the defined line automatically, considering you have only the months data you want to average there:
=$D$2:INDEX($2:$2;COUNTA($2:$2))
Then, the formula for calculating John's average is:
=AVERAGE(JohnAvg)
=AVERAGE(OFFSET(F2,0,4-COLUMN(),1,COLUMN()-4))
(Written to start in cell F2)
This will use OFFSET to create a Range that starts in Column 4 (D) and extends until the Column before the Cell that the formula is written in.