+ Reply to Thread
Results 1 to 8 of 8

Average same cells on different sheets ignoring any containing text

  1. #1
    Valued Forum Contributor
    Join Date
    01-16-2012
    Location
    England
    MS-Off Ver
    MS 365 Version 2501 64-bit
    Posts
    1,465

    Average same cells on different sheets ignoring any containing text

    Should be simple but can't find the answer.

    "Summary" ws cell J6 has to show the average value of cells J6 in five other sheets, ignoring any that are not numbers, as users may leave them blank or type "N/A" or something else.

    if the five cells were in the same sheet (e.g. J6:J10, with J8 being "N/A" text, and the four others totalling 10), the formula "=Average(J6:J10)" ignores the "non number" in J8 and gives the result as 2.5

    Tried various approaches, but can't see the syntax when the cells to add are on different sheets?

    All answers appreciated gratefully as ever

    Ochimus

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    47,995

    Re: Average same cells on different sheets ignoring any containing text

    Have you tried:
    Formula: copy to clipboard
    Please Login or Register  to view this content.



    Rgards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Valued Forum Contributor
    Join Date
    01-16-2012
    Location
    England
    MS-Off Ver
    MS 365 Version 2501 64-bit
    Posts
    1,465

    Re: Average same cells on different sheets ignoring any containing text

    Good evening TMS,

    Appreciate the prompt response and suggestion.

    I put "1%" into Sheet 2, and 4% into Sheet 5 and left the other three blank.

    Your formula in the Summary sheet generated a "#Name" error.

    Changed sheet 6 to "N/A" and got same error message

    Ochimus

  4. #4
    Valued Forum Contributor
    Join Date
    01-16-2012
    Location
    England
    MS-Off Ver
    MS 365 Version 2501 64-bit
    Posts
    1,465

    Re: Average same cells on different sheets ignoring any containing text

    Actual workbook Sum Cells.xlsx attached, with all extraneous cols and rows redacted.

    If it works in J6 it will work in every other column and range I need.

    Ochimus

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    47,995

    Re: Average same cells on different sheets ignoring any containing text

    Have a look at the example workbook attached.

    If this doesn't help, you will need to post a sample workbook of your own.


    I
    J
    K
    L
    M
    5
    6
    3.75
    =AVERAGE(Sheet2:Sheet6!J6)
    7
    8
    2
    2
    =Sheet2!J6
    9
    3
    3
    =Sheet3!J6
    10
    4
    4
    =Sheet4!J6
    11
    N/A
    N/A
    =Sheet5!J6
    12
    6
    6
    =Sheet6!J6
    13
    3.75
    =AVERAGE(K8:K12)
    14
    3.75
    =AVERAGE(Sheet1!J8:J12)
    15
    Attached Files Attached Files

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    47,995

    Re: Average same cells on different sheets ignoring any containing text

    It would probably help if you referred to the sheets in YOUR workbook:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    And I would suggest that you name them consistently, with or without the space.

    Regards, TMS

  7. #7
    Valued Forum Contributor
    Join Date
    01-16-2012
    Location
    England
    MS-Off Ver
    MS 365 Version 2501 64-bit
    Posts
    1,465

    Re: Average same cells on different sheets ignoring any containing text

    TMS,

    Your approach using the sheet names rather than the sheet numbers did the trick,

    I hadn't noticed originally that the "week1" sheet had no space when I received the file, but as my original attempts used the sheet numbers it would have been academic anyway.

    Slightly intrigued as to why that approach didn't work, but life is too short. . .

    Ochimus

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    47,995

    Re: Average same cells on different sheets ignoring any containing text

    You're welcome. Thanks for the rep.


    You can use Sheet Numbers and Sheet Code Names in VBA but you have to use Sheet Names in the worksheet. Note that, if the Sheet Names have spaces, you need to encapsulate them in single quotes ('), for example:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    but
    Formula: copy to clipboard
    Please Login or Register  to view this content.



    Regards, TMS

+ 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. Using Average and ignoring cells with #div/0
    By worthm in forum Excel General
    Replies: 3
    Last Post: 12-08-2014, 06:58 PM
  2. Sumproduct Average ignoring blank cells
    By fgruhlke in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-13-2014, 12:32 PM
  3. Average Ignoring Zero Values - Non-consecutive cells
    By a7mad3wies in forum Excel General
    Replies: 2
    Last Post: 12-05-2013, 02:13 AM
  4. Getting average but ignoring cells with blank (#value!)
    By Elainefish in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-23-2013, 08:30 AM
  5. Average ignoring Blanks cells
    By Justinmih in forum Excel General
    Replies: 10
    Last Post: 09-30-2011, 06:21 PM
  6. average %'s between sheets (ignoring blank)
    By simpson in forum Excel General
    Replies: 0
    Last Post: 03-09-2010, 03:19 PM
  7. [SOLVED] 30 Day Moving Average Ignoring Blank Cells
    By ethatch in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-17-2006, 05:40 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