Question: Did I use averageif wrong

ay123

New Member
Joined
Oct 21, 2020
Messages
11
Platform
  1. MacOS
Hi, so I used the formula =AVERAGEIF(L2:L1000, ">10", G2:G1000) to calculate the average of my data, however, excel shows an error saying "AVERAGEIF caused a divide by zero error". But, when i tried =AVERAGEIF(L2:L1000, "11", G2:G1000) it did work. Does anyone know what went wrong? I'm kind of confused. Thanks!
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Could it be that your range L21:L1000 are text and not numeric?
 
Upvote 0
Just to check - you are trying to average column G based on the values in column L, and not the other way round?
 
Upvote 0
The reason I'm thinking your column L is not numeric is your first formula with ">10" fails.
I would test a value in your column L with the ISNUMBER function and see what it returns.
 
Upvote 0
Do you have any error values in column G?
 
Upvote 0
Ok, I tried the isnumber function and it returned with false. Perhaps because column L are also all functions? But I'm not sure since column L's functions all return with numbers.

I'm also confused why =AVERAGEIF(L2:L1000, "11", G2:G1000) will work, but =AVERAGEIF(L2:L1000, ">10", G2:G1000) doesn't work.
 
Upvote 0
What is the function you are using in column L? The function is returning text, so ">10" will return 0 items and you get the the #DIV/0! error.
The "11" will work since you have some 11's in column L (in this case the AVERAGEIF function doesn't seem to care if the 11's are text or numeric). Sometimes you can get a formula to return a number by adding 0 to the formula. Try adding a +0 to the end of your formulas in column L.
 
Upvote 0
Solution

Forum statistics

Threads
1,215,059
Messages
6,122,918
Members
449,093
Latest member
dbomb1414

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