AVERAGEIFS formula when evaluating not being equal to a number with leading zeros

Shellecj

New Member
Joined
Aug 3, 2013
Messages
32
Can someone please clarify why I'm having trouble with getting accurate results with the following formula? The formula will average the amount of ALL sales that took place within the specified date range in the formula (named cell ranges "begin_date" & "ending_date") and not eliminate the records with the ID of 001.

=AVERAGEFS(A1:A100,B1:B100,"<>001",C1:C100,">="&begin_date,C1:C100,"<="&ending_date) Note: I did also try "<>"&"001" to no avail.


On the contrary the formula seems to work fine when averaging the range for all that ARE equal to 001 (i.e. entering the formula in this form: =AVERAGEFS(A1:A100,B1:B100,"001",C1:C100,">="&begin_date,C1:C100,"<="&ending_date) ) but for some reason it will not work when using the operator <>.

I played around with the formula and tried substituting all ID's that were 001 with a text string of abc and then replaced the 001 in the formula with abc and then finally it worked.

Another note to point out is the "001" is the result of a formula that is extracting a 3 digit code from a string in another column elsewhere in the sheet using the LEFT function.
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
is this a typo?
=AVERAGEFS(A1:A100,

worked perfectly for me
=AVERAGEIFS(A1:A100,B1:B100,"<>001",C1:C100,">="&begin_date,C1:C100,"<="&ending_date)

M.
 
Upvote 0
Sorry that was a typo. For some reason Copy and Paste wasn't working so I manually typed that in. I do have it typed correctly in my worksheet.

I don't know why it's not working for me though? But again, where that ID code is being referenced from is a column on another worksheet that is also populated with a formula ( =LEFT(A2,3) )
 
Upvote 0
What you mean by is not working? An error or wrong result?

Could you provide a data sample, say, 10 rows and expected result?

M.
 
Upvote 0
No, no error..it will give me the average of ALL records within those dates, including records with the ID's of 001

I can try to extract a sample of my data to a test sheet later and upload. Don't have something like that readily available at the moment other than my actual data which is confidential material. I'll circle back to this thread when I can to upload some kind of sample to evaluate.

Thanks Marcelo!
 
Upvote 0

Forum statistics

Threads
1,216,482
Messages
6,130,928
Members
449,607
Latest member
babylegs

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