+ Reply to Thread
Results 1 to 7 of 7

Problem using AVERAGEIF to eliminate zeros

  1. #1
    Registered User
    Join Date
    11-08-2017
    Location
    Gainesville, Florida, US
    MS-Off Ver
    2010
    Posts
    1

    Question Problem using AVERAGEIF to eliminate zeros

    Good Morning,

    I am trying to use the following formula and I keep getting a #VALUE ! error:

    AVERAGEIF(Firm1:Firm70!E46, "<>0")

    I would like to get an overall average for a particular survey question, but I want to exclude zeros. I have each firm's submission in a separate sheet. Any clue what I am doing wrong?

  2. #2
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Problem using AVERAGEIF to eliminate zeros

    Hello and welcome to the forum.

    You can't use a 3D reference with AVERAGEIF, SUMIF, COUNTIF, etc.

    See here for a list of the functions that can use a 3D reference:
    https://support.office.com/en-us/art...ID=HP010102346

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,223

    Re: Problem using AVERAGEIF to eliminate zeros

    Attach a sample workbook (not image).

    Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate.

    Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,223

    Re: Problem using AVERAGEIF to eliminate zeros

    Try

    =SUMPRODUCT(SUMIF(INDIRECT("'" &Sheets &"'!E46"), "<>0"))/SUMPRODUCT(COUNTIF(INDIRECT("'" &Sheets &"'!E46"), "<>0"))

    where Sheets is a named range of all your sheets (Firm1,Firm2......Firm70)

  5. #5
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Problem using AVERAGEIF to eliminate zeros

    Quote Originally Posted by ColleenMarie47 View Post
    I have each firm's submission in a separate sheet.
    This is not a good way to keep your data. If you plan on doing anything with your data (like you are here), I HIGHLY recommend re-structuring your workbook.

    There should be one worksheet with all of the data on it.
    This worksheet should have all of the survey questions in a separate column, all of the firms listed in separate rows, and each firm's answer to each question in the correct cell (wherever the row and column intersect).

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Problem using AVERAGEIF to eliminate zeros

    Quote Originally Posted by 63falcondude View Post
    This is not a good way to keep your data. If you plan on doing anything with your data (like you are here), I HIGHLY recommend re-structuring your workbook.
    I couldn't agree more.

    A lot of people start by designing the workbook that they expect to see as the final report or which at first glance seems the best way of capturing data, and then wonder why it's so difficult to subsequently analyse and summarise or extract information from it.

    You should always capture data in a simple two dimensional table and worry about reporting information from it afterwards. Without exception doing this you will always be able to easily obtain management information. Rarely is this the case if you start the other way round.
    You will also throw open the whole wonderful world of the powerful Pivot table functionality.

    So before you get too far with this I'd create a single sheet database that contains all the columns and data from your individual sheet and with an additional column that holds the Firm name on each row. You could quickly create a macro that loops through all sheets and copies and pastes the data to the single sheet database.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  7. #7
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Problem using AVERAGEIF to eliminate zeros

    Quote Originally Posted by 63falcondude View Post
    It's not on that list but FREQUENCY function also accepts a 3D reference, so assuming there are no negative numbers in the data you can get the average ignoring zeroes like this:

    =SUM(Firm1:Firm70!E46)/INDEX(FREQUENCY(Firm1:Firm70!E46,0),2)
    Audere est facere

+ 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. [SOLVED] Averageif, not counting zeros, but in multiple ranges)
    By Alphabex in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 01-08-2022, 01:38 PM
  2. [SOLVED] How to eliminate zeros in a row
    By vademo0o in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-21-2013, 02:55 PM
  3. [SOLVED] AverageIf by excluding zeros?
    By Artis89 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 07-17-2012, 02:18 PM
  4. AverageIf Formula Counting zeros grrr
    By AllenMead in forum Excel General
    Replies: 3
    Last Post: 10-31-2010, 11:41 AM
  5. How do I eliminate leading zeros from downloaded data?
    By Vanessa in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM
  6. [SOLVED] How do I eliminate zeros from my Excel database?
    By kbschlepp in forum Excel General
    Replies: 5
    Last Post: 01-15-2005, 11:06 PM
  7. [SOLVED] How do I eliminate zeros from my Excel database?
    By HDOTM in forum Excel General
    Replies: 1
    Last Post: 01-13-2005, 04:06 PM

Tags for this Thread

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