+ Reply to Thread
Results 1 to 7 of 7

Average sum

  1. #1
    Registered User
    Join Date
    04-05-2016
    Location
    Sharjah, UAE
    MS-Off Ver
    2010
    Posts
    6

    Average sum

    Hello,
    I have a problem with averaging out some numbers.

    The average formula im using is not calculating as it should consider also if N/A

    =IF(AND(G6,G12,G18,G24,G30,G36="N/A"),"N/A",AVERAGE(G6,G12,G18,G24,G30,G36))

    If I use only AVERAGE(G6,G12,G18,G24,G30,G36)) formula the problem is that if the fields are all N/A then it will give me a DIV/0! and I cant have that as it will mess up the formula in another sheet I will be adding.

    Please see the attached sheet. I'm trying to fix cell G50 Formula.

    Thanks for your help!
    Final upload should be the correct one.audittool1.xlsx
    Attached Files Attached Files
    Last edited by samiroma; 05-16-2016 at 10:29 AM.

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Average sum

    For a start you're using the wrong syntax. This

    AND(G6,G12,G18,G24,G30,G36="N/A")

    would need to be

    AND(G6="N/A",G12="N/A",G18="N/A",G24="N/A",G30="N/A",G36="N/A")
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Average sum

    Form what I can make out, you want G6 etc to show NA if ANY values in G4:G5 are NA?

    Also, you have a few things not quite right there.

    1. You seem to over-complicate your formulas
    If D is always a %, then you dont need to calc that as a weight, it already is that
    H4=IF(G4="N/A", "N/A", G4 * D4 / SUMIF($G$4:$G$5, "<>"&"N/A", $D$4:$D$5))
    just needs to be...
    =IF(G5="N/A", "N/A", G5 * D5)
    Copied down

    Instead of just N/A - which excel sees as just text, would you consider using #N/A - which excel sees as an error?

    G6=IF(AND(H4:H5="N/A"),"N/A",SUM(H4:H5))
    You have this ARRAY entered (wrapped in {}, this is not necessary, and could slow your file down if used a lot.

    (working on more, for you)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: Average sum

    G6=IF(AND(H4:H5="N/A"),"N/A",SUM(H4:H5))
    could be...
    =SUMPRODUCT(D4:D5*G4:G5)

  5. #5
    Registered User
    Join Date
    04-05-2016
    Location
    Sharjah, UAE
    MS-Off Ver
    2010
    Posts
    6

    Re: Average sum

    Dear All thanks for your replies.
    I have reviewed your replies however my problem is currently in Cell G50. All other cells are fine and calculating well. However just a quick reply since you
    took time to reply I tried your solutions to improve my sheet:

    Special-K, correcting the syntax didn't resolve the issue, now I get a #value! error.
    FDibbins if I dont use the array to calculate the total in G6 I will get a #Value error no matter what is displayed in G4 or G5
    FDibbins =SUMPRODUCT(D4:D5*G4:G5) will give #Value! error if in G4 or G5 there is N/A value

    Again my issue is with formula in cell G50 or G52

    The average formula im using (below) is not calculating the averages of G6,G12,G18,G24,G30,G36,G42,G48 as it should consider also N/A. This is need to fix.

    G50=IF(AND(G6,G12,G18,G24,G30,G36="N/A"),"N/A",AVERAGE(G6,G12,G18,G24,G30,G36,G42,G48))
    (by the way should I change the value of G46 to give different result if G48 then the G50 formula will work as a charm!! But its only doing it for G48 I dont know why)

    If I use only G52=AVERAGE(G6,G12,G18,G24,G30,G36,G42,G48) formula the problem is that if the fields are all N/A then it will give me a DIV/0! and I cant have that as it will mess up the formula in another sheet I will be adding.

    Thank you all for your efforts!
    Added updated version with all columns unhidden.
    audittool2.xlsx

  6. #6
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,913

    Re: Average sum

    Try this ...
    =IFERROR(AVERAGE(G6,G12,G18,G24,G30,G36,G42,G48),"NA")

  7. #7
    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,206

    Re: Average sum

    In G50

    =IF(AND(G6="N/A",G12="N/A",G18="N/A",G24="N/A",G30="N/A",G36="N/A",G42="N/A",G48="N/A"),"N/A",AVERAGE(G6,G12,G18,G24,G30,G36,G42,G48))

+ 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. SumProduct N/A Error, Quarterly Average, Running Average, From and to Userform
    By Sorjas in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-18-2015, 07:40 PM
  2. [SOLVED] need formula to average cells but if one cell has N/A then dont average and input N/A
    By CityInspector in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-08-2013, 04:16 PM
  3. [SOLVED] Find Average, Return Column Header of Number Closest To Average
    By djmyers in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 07-07-2013, 04:19 PM
  4. Replies: 14
    Last Post: 06-14-2013, 09:00 PM
  5. Replies: 10
    Last Post: 04-25-2013, 06:12 PM
  6. The rank of average ranks excluding empty cells but including their average.
    By Terminal45 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-21-2012, 03:44 AM
  7. Replies: 5
    Last Post: 06-19-2012, 04:37 PM

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