Exceltrackworld
 

MegaSack DRAW - This year's winner is user - rgwb
We will be in touch

[Closed] Exceltrackworld

10 Posts
8 Users
0 Reactions
57 Views
Posts: 18
Free Member
Topic starter
 

I have a worksheet that has 7 columns representing a monthly score.

There are some rows that have no score in column 7

In column 8 i want to display the average of the the last 6 columns with a score, ignoring the blank cell and calculating the average on the 6 cells that have a value.

For example

Row 1 80% 80% 80% 80% 90% 90% 90%
Row 2 80% 80% 80% 80% 90% 90% blank

Row 1 result would be 85%
Row 2 result would be 83.33%

This is easy I know, just not had enough coffee to figure it out.


 
Posted : 19/02/2013 11:45 am
Posts: 0
Free Member
 

Assuming Row 1, data starting in column A;
In column 8, =AVERAGE(A1:A7) the function ignores blank cells


 
Posted : 19/02/2013 11:50 am
Posts: 0
Full Member
 

As long as the empty cells are blank and not 0s then =average(range) will work.


 
Posted : 19/02/2013 11:51 am
Posts: 0
Free Member
 

=average(cells)

this ignores the blank cells


 
Posted : 19/02/2013 11:54 am
Posts: 173
Free Member
 

If it's always just column 7 that may be blank, then it's pretty easy:

Enter in column 8 (H):

=IF(G1<>"",average(B1:G1),average(A1:F1))

Haven't checked my syntax on that, but shouldn't be far off.

EDIT: For the above replies, that's not what he wants. If you just use the AVERAGE function like that, then you'll get an average of all 7 values when there are 7 values present, not the last 6.

EDIT 2: Bored enough to check my syntax - it's correct.


 
Posted : 19/02/2013 11:55 am
Posts: 0
Free Member
 

=SUM(A1:F1)/6

A1 is the first cell, F1 is you last cell.

At least, that's how I'd do it.


 
Posted : 19/02/2013 11:55 am
Posts: 0
Free Member
 

=IF(LEN(G1)>0,AVERAGE(B1:G1),AVERAGE(A1:F1))

too slow. +1 what stevomcd says


 
Posted : 19/02/2013 11:56 am
Posts: 18
Free Member
Topic starter
 

That's great guys thanks.

I didn't want a simple average of all seven cells, just the last 6 with results in. Thanks again.


 
Posted : 19/02/2013 12:00 pm
Posts: 36
Free Member
 

If you use COUNT to define your denominator then you are averaging only those cells with values in.

=SUM(B3:F3)/COUNT(B3:F3)

If a cell in the range is blank, then it will not COUNT it.
But it must be blank. i.e. not 0 and not ""

If you actually have 0 or "" then let me know as there is another technique.


 
Posted : 19/02/2013 12:08 pm
Posts: 173
Free Member
 

stoner - that would still give the wrong result when all 7 cells have values.


 
Posted : 19/02/2013 12:15 pm
Posts: 36
Free Member
 

aha.
well I 'spose if the structure is consistent then a simple IF function would do it, but it seems so ungainly 🙂


 
Posted : 19/02/2013 12:20 pm