Average in Excel

niladri2005

Board Regular
Joined
Sep 21, 2012
Messages
109
Hi All,

I have four colums. I wan to get the average from it. For Example

A B C D
12 - 25 -
- 45 - -
- - 17 34


when I am writing formula in E1 I am getting error for "-" sign. What I want is that where there is "-" sign it should avoid that cell and give me the average of the remaining cell. I am trying with if and and formula but no result found.

Can you please guide me?

Thanks in advance!!
 
Last edited:
Hi All,

I have used this formula in E1 and

=AVERAGE(IF(ISNUMBER(A1),A1,0)+IF(ISNUMBER(B1),B1,0)+IF(ISNUMBER(C1),C1,0)+IF(ISNUMBER(D1),D1,0)) and getting result 37. It should show me 18.5
 
Upvote 0

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
E1:

=AVERAGE(A1:D1)

yields 18.5 for me, as it should.

Did you perhaps invoke

=SUM(A1:D1)

instead?

Indeed: in cell E1 this formula does it, =AVERAGE(A1:D1)

He might not be using the AVERAGE formula as you implied. However I thought he would like avg of all columns, regardless of number/not number. (9,25 for first row)


This does not work for y ou niladri?
 
Upvote 0
Hi All,

I have used this formula in E1 and

=AVERAGE(IF(ISNUMBER(A1),A1,0)+IF(ISNUMBER(B1),B1,0)+IF(ISNUMBER(C1),C1,0)+IF(ISNUMBER(D1),D1,0)) and getting result 37. It should show me 18.5

Yes, you should just use =AVERAGE(A1:D1)

I thought you wanted average for all 4 columns, given that a "-" did mean zero.

PS: I noticed your problem and revized it above.(added COUNTA, after the formula you are now using) :)
 
Upvote 0
Yes...Now i got it...

when thee are four "-" then I am getting #DIV/0! error. To fix this issue I need to apply iferror...


Thanks you all!!!
 
Upvote 0
Yes...Now i got it...

when thee are four "-" then I am getting #DIV/0! error. To fix this issue I need to apply iferror...


Thanks you all!!!

You did not explain why you had 37 for the first record!...

=IFERROR(AVERAGE(A1:D1),"")

appears what you need. If you don't have IFERROR, try:

=SUM(A1:D1)/MAX(1,COUNT(A1:D1))
 
Upvote 0

Forum statistics

Threads
1,224,974
Messages
6,182,100
Members
453,088
Latest member
Chaoxite

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top