Hi,
I need to know how the obtain the average of a group of cells in a column. There will be cells without data, so the average should only include the cells with data.
Thanks,
Leesha
average a column
-
- 2StarLounger
- Posts: 112
- Joined: 25 Jan 2010, 20:19
Re: average a column
The average function only takes cell with numeric values into consideration when calculating. Blank cells and cells with text, within the range are ignored.
-
- BronzeLounger
- Posts: 1488
- Joined: 05 Feb 2010, 22:25
Re: average a column
Thanks! I didn't realize that.
Leesha
Leesha
-
- BronzeLounger
- Posts: 1488
- Joined: 05 Feb 2010, 22:25
Re: average a column
Another question, what would the formula look like if the cell contains a zero. The user doesn't want the cells with zero counted.
Thanks!
Thanks!
-
- 2StarLounger
- Posts: 112
- Joined: 25 Jan 2010, 20:19
Re: average a column
If your user has a version of Excel prior to 2007 you can use the array formula (confirmed with Ctrl+Shift+Enter) of:
=AVERAGE(IF(A1:A8<>0,A1:A8))
For 2007 and up:
=AVERAGEIF(A1:A8,"<>0")
Adjust the ranges as necessary of course.
=AVERAGE(IF(A1:A8<>0,A1:A8))
For 2007 and up:
=AVERAGEIF(A1:A8,"<>0")
Adjust the ranges as necessary of course.
-
- BronzeLounger
- Posts: 1488
- Joined: 05 Feb 2010, 22:25
Re: average a column
I'm not sure what is wrong with this. It's returning a value error.
Thanks,
Leesha
Thanks,
Leesha
You do not have the required permissions to view the files attached to this post.
-
- Administrator
- Posts: 78512
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: average a column
The formula is an array formula, i.e. you must confirm it with Ctrl+Shift+Enter (as Mike Barron indicated in his reply), not just with Enter.
Best wishes,
Hans
Hans
-
- Administrator
- Posts: 12611
- Joined: 16 Jan 2010, 15:49
- Location: London, Europe
Re: average a column
Because this is an array formula you need to enter it in the cell and type Control-Shift-Enter
If you do this it will work fine.
If you do this it will work fine.
StuartR
-
- BronzeLounger
- Posts: 1488
- Joined: 05 Feb 2010, 22:25
Re: average a column
I actually type control-shift-enter after the formula in the same cell?
-
- Administrator
- Posts: 78512
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: average a column
Either double-click the cell, or click on the cell and press F2, or click on the cell, then in the formula bar.Leesha wrote:I actually type control-shift-enter after the formula in the same cell?
Either of these will start edit mode.
Then (without actually changing the formula) press Ctrl+Shift+Enter, i.e. hold down Ctrl and Shift, press Enter, then release Ctrl and Shift.
You should see braces { } around the formula in the formula bar; this indicates that you have turned the formula into an array formula.
(Do *not* type the braces { } yourself, that won't work)
Best wishes,
Hans
Hans
-
- BronzeLounger
- Posts: 1488
- Joined: 05 Feb 2010, 22:25
Re: average a column
Thanks! Worked perfectly!
Leesha
Leesha
-
- BronzeLounger
- Posts: 1488
- Joined: 05 Feb 2010, 22:25
Re: average a column
I just wanted to let everyone know who helped me on this one that the end user is beside herself with gratitude! She thinks I'm the genius LOL but I told her its with this forum.
Thanks again,
Leesha
Thanks again,
Leesha