+ Reply to Thread
Results 1 to 5 of 5

Only include numbers in a certain range for AVERAGEIFS

  1. #1
    Registered User
    Join Date
    10-23-2020
    Location
    Boston
    MS-Off Ver
    Office Standard 2019
    Posts
    3

    Only include numbers in a certain range for AVERAGEIFS

    I'm trying to make a formula that averages the prices of vehicles that match the year, make, model, and are within +-10,000 miles of the odometer reading. I'm having trouble with implementing the +- part of the mileage. I've tried (H:H,">"&DJ2&"-10000",H:H,"<"&DJ2&"+10000") where H is the column with the odometer values and cell DJ2 is the odometer reading being used for reference. I am very much a novice, so any help would be appreciated.

  2. #2
    Forum Expert
    Join Date
    09-07-2014
    Location
    Israel
    MS-Off Ver
    office 365 for MAC
    Posts
    3,105

    Re: Only include numbers in a certain range for AVERAGEIFS

    Hi
    can you please attached the file with the formula that is not working?

  3. #3
    Registered User
    Join Date
    10-23-2020
    Location
    Boston
    MS-Off Ver
    Office Standard 2019
    Posts
    3

    Re: Only include numbers in a certain range for AVERAGEIFS

    Sorry, the file I'm working with is quite large so I didn't want to include it. This smaller version should have the relevant information though. Cell L2 is the full formula I'm trying, cell N2 is the formula without including anything about the odometer, to show it works otherwise. As you can see, if I had the accurate formula for what I'm attempting both rows 12 and 15 would fit the criteria.
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,858

    Re: Only include numbers in a certain range for AVERAGEIFS

    I see confusion over math and text operators. +/- are the math operators for addition and subtraction. & is the concatenate operator for joining text strings. Using the evaluate formula tool (if you are unfamiliar: https://support.microsoft.com/en-us/...rs=en-us&ad=us ), I can see that your formula is attempting to find the average for records where the odometer reading (a number) is between the text strings "158579-10000" (which does NOT evaluate to 148579) and "158579+10000 (which also does not evaluate to 168579). A number will never be between two text strings, so the result is Div/0.

    Solution is to get the correct operators in your criteria arguments. Something like averageifs(...,H:H,">"&DJ2-10000,H:H,"<"&DJ2+10000). See if that helps.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  5. #5
    Registered User
    Join Date
    10-23-2020
    Location
    Boston
    MS-Off Ver
    Office Standard 2019
    Posts
    3

    Re: Only include numbers in a certain range for AVERAGEIFS

    That did the trick! Thank you. I had no idea what the & was actually doing, I only saw it was necessary to get the cell recognized in the formula by trial and error. This explanation is a great help!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Applying AVERAGEIFS on columns that include text
    By byteroom in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-11-2019, 08:49 AM
  2. [SOLVED] Counting a range of cells that include text and numbers
    By jbourne21 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-30-2015, 05:58 AM
  3. AVERAGEIFS and range for criteria?
    By MaverickBlack in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-13-2015, 05:35 AM
  4. How to include specified months in a AverageIfs Formula
    By cartica in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-12-2015, 11:11 AM
  5. [SOLVED] How to get an AVERAGEIFS formula to not include cell in average, by triggering switch?
    By Carmstrong227 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-19-2013, 01:15 PM
  6. AVERAGEIFS() with criteria that a string NOT include specific text
    By tjnelso in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-06-2013, 07:30 PM
  7. [SOLVED] Modifying AVERAGEIFS function to include certain data
    By Ezomz in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-14-2013, 11:35 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1