Excel Average Function

bucky6225

New Member
I have rows of data I'm trying to average, but am having trouble. I think there could be two problems.

1. Each cell is a vlookup function getting the data from elsewhere.
2. Some of the cells have no datapoint and instead display "#N/A".

I have data points in K38:N38, but O38 and P38 both show "#N/A". If I want to average K38:P38 how do I get a number back?

Thanks

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

MrKowz

Well-known Member
you have to add in an if statement for the vlookup like

=IF(iserror(*vlookup function*),"",*vlookup function*)

That way, if it cannot find a value, instead of showing N/A for the vlookup, it will return a blank

DonkeyOte

MrExcel MVP
correcting the vlookup is certainly a good option -- alternative would be the below (as an array)

=SUM(IF(ISNUMBER(K28:P28),K28:P28))/COUNT(K28:P28)

(commit to array using SHIFT+CTRL+ENTER -- formula will become encase in {...})

bucky6225

New Member
Hey Guys,

Thanks for the replies, but I made a mistake in describing the problem. It's actually not a vlookup, but a rank function that I am using. Don't know if this makes a difference.

In cell K38 I have the following formula: =RANK(K2,K\$2:K\$32, 1)
In cells L38, =RANK(L2,L\$2:L\$32, 1)
and so on.

In cells N38 and O38 I have the same formulas but they are returning "#N/A" because the cells in columns they are trying to rank are blank. What formula should I use so there won't be a "#N/A" but a blank?

Thanks again.

MrKowz

Well-known Member
use the same function i listed above, but instead put in the rank function where I have the *vlookup function* part.

The function basically says:

If the result of your function is an error, then it will return a blank spot, otherwise it will return the result of your function

bucky6225

New Member
worked great. Thanks!

Replies
8
Views
250
Replies
3
Views
298
Replies
5
Views
231
Replies
1
Views
107
Replies
3
Views
112

1,191,672
Messages
5,987,959
Members
440,122
Latest member
branhill

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?

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

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