+ Reply to Thread
Results 1 to 26 of 26

Need Help with Average formula

  1. #1
    Registered User
    Join Date
    06-25-2019
    Location
    Denver,CO
    MS-Off Ver
    2016
    Posts
    13

    Need Help with Average formula

    I need some help getting a formula to calculate the average of 4 non contiguous cells that have a number and text (ie cell P10= "86.79% of green apples").
    I need to average 4 cells P10,P19,P28,P37.
    P10= 86.79% of green apples
    P19= 88.73% of green apples
    P28= 0% of green apples
    P37= 0% of green apples

    Currently I have this:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    and P46= 43.88% of green apples

    So it's calculating the average but I need it to not include P28 and P37 since they are zero and need P46 to say 87.76% of green apples.

    However P10,P19,P28,P37 all are also updated based on other inputs so if the sheet gets updated and P28 becomes 85.77%, I would then need P46 to updated to 87.10% since it would've taken the average of 3 numbers instead of just the 2.

    I think my formula should be an AVERAGEIF function, but don't know how to make it work with multiple cells like this.

    Thanks for taking a look, and let me know what other information is needed, if any.

  2. #2
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Need Help with Average formula

    Hello that green. Welcome to the forum.

    Try array entering this in P46.

    If you aren’t familiar with array-entered formulas array enter means the formula must be committed from edit mode by simultaneously pressing and holding down Ctrl and Shift while hitting Enter.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    It returns 87.76% of green apples at my end.
    Dave

  3. #3
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Need Help with Average formula

    This is a little shorter. Still array entered.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    06-25-2019
    Location
    Denver,CO
    MS-Off Ver
    2016
    Posts
    13

    Re: Need Help with Average formula

    Thank you for both of these solutions, however neither worked for me. Is one of them supposed to work better than the other? I'm still fairly new to excel and not very familiar with the formulas you provided.
    Also I should note that P1:P45 also have data in them that could display 0%, however none of the other cells (aside from the original 4) contain the &"% of green apples", some contain "% of (x,y,Z)"

    I just want to make sure that the formula will only be including the cells P10,P19,P28,P37 as those 4 particular cells contain the "% of green apples"

    Thanks again!
    Last edited by thatgreen; 06-25-2019 at 09:31 PM.

  5. #5
    Registered User
    Join Date
    06-25-2019
    Location
    Denver,CO
    MS-Off Ver
    2016
    Posts
    13

    Re: Need Help with Average formula

    Okay I'm attaching a link to a photo of my spreadsheet to hopefully help understand better. Forget apples. Basically I am trying to get an Average in P46 that is the Average of P10,P19,P28,P37. However if any of P10,P19,P28,P37 are 0.00% (like currently P28,P37 are) it only averages the cells that have values >0. Currently I need P46 to =87.76% not 43.88%.

    excel.png

  6. #6
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Need Help with Average formula

    Please attach the Excel workbook. No one wants to retype data you already have.


    To attach a file to your post: (Please no pics or screenshots ... saves retyping data.),

    be sure to desensitize the data
    • click “Go Advanced” (next to Post Quick Reply – bottom right),
    • scroll down until you see “Manage Attachments”, click that,
    • click “Browse”.
    • select your file(s)
    • click “Upload”
    • click “Close window”
    • click “Submit Reply”

    The file name will appear at the bottom of your reply.

  7. #7
    Registered User
    Join Date
    06-25-2019
    Location
    Denver,CO
    MS-Off Ver
    2016
    Posts
    13

    Re: Need Help with Average formula

    See that's my problem, desensitizing the data is over 50 sheets for me. This is 1 column that calculates from all over the workbook. Any other options?

  8. #8
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Need Help with Average formula

    We don't need to see all 50 sheets. Just the rows P4:P47 you show in the screen shot should suffice with instructions relevant to the sample. Dummy up the "blacked out" data.

  9. #9
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Need Help with Average formula

    Quote Originally Posted by thatgreen View Post
    ... Also I should note that P1:P45 also have data in them that could display 0%, however none of the other cells (aside from the original 4) contain the &"% of green apples", some contain "% of (x,y,Z)"

    I just want to make sure that the formula will only be including the cells P10,P19,P28,P37 as those 4 particular cells contain the "% of green apples"
    Yes. My first formula does that.

    Please see the attached with slight modification to 1st formula.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    06-25-2019
    Location
    Denver,CO
    MS-Off Ver
    2016
    Posts
    13

    Re: Need Help with Average formula

    I am attaching what you are asking for, but I don't know if it will really help. Everything is just a REF because its all pulling from elsewhere.
    Attached Files Attached Files

  11. #11
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Need Help with Average formula

    Try copying what you have and pasting values only back into the range. The formulas will no longer be there. Only the values remain.

  12. #12
    Registered User
    Join Date
    06-25-2019
    Location
    Denver,CO
    MS-Off Ver
    2016
    Posts
    13

    Re: Need Help with Average formula

    Okay try this, the left 2 columns are just values, the right 2 columns are the formulas I'm using to get those values.
    Attached Files Attached Files

  13. #13
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Need Help with Average formula

    Array enter in A48 (Ctrl + Shift + Enter)
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  14. #14
    Registered User
    Join Date
    06-25-2019
    Location
    Denver,CO
    MS-Off Ver
    2016
    Posts
    13

    Re: Need Help with Average formula

    Okay well I got the following message display, and the cell on my worksheet says 0.00... Thoughts?
    Attachment 629707

  15. #15
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Need Help with Average formula

    Does it do that in my attached?
    Attached Files Attached Files

  16. #16
    Registered User
    Join Date
    06-25-2019
    Location
    Denver,CO
    MS-Off Ver
    2016
    Posts
    13

    Re: Need Help with Average formula

    With the new one, if I enter as array it says "Array formulas are not valid in merged cells" Is this because I format P:Q together? If I don't enter as array is just returns 0.00.

    Edit: Even if I un-merge P:Q and just enter this in P it still returns 0.00.

    Also bear in mind I did change all of A's in the functions to P's for my sake.

  17. #17
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Need Help with Average formula

    Quote Originally Posted by thatgreen View Post
    With the new one, if I enter as array it says "Array formulas are not valid in merged cells" Is this because I format P:Q together? If I don't enter as array is just returns 0.00.

    Edit: Even if I un-merge P:Q and just enter this in P it still returns 0.00.

    Also bear in mind I did change all of A's in the functions to P's for my sake.
    • Do you see that the formula is working in my upload?
    • Once you un-merge the cells the formula must be array entered.
    • Did you reference the new source range in the formula?
    • Is the formatting of the data you are using consistent with your previous upload?
    Last edited by FlameRetired; 06-26-2019 at 01:46 AM.

  18. #18
    Registered User
    Join Date
    06-25-2019
    Location
    Denver,CO
    MS-Off Ver
    2016
    Posts
    13

    Re: Need Help with Average formula

    • Do you see that the formula is working in my upload?
      - Yes, I do, which is why I don't understand why it's not working in mine. Like I stated I don't really understand exactly what your function is doing it, otherwise maybe I just need 1 additional tweak?
    • Once you un-merge the cells the formula must be array entered.
      - Correct, it was, and it is currently displaying 0.00
    • Did you reference the new source range in the formula?
      - Well I changed all the A1:A47 to P1:P47 (where my data is) so, I think so...?
    • Is the formatting of the data you are using consistent with your previous upload?
      - Yes, but there is just a lot more data around and in the workbook altogether. Each cell of P1:P47 is basically calculating from different sheets depending on the cell. So P10,P19,P28,P37 are numbers located on different sheets within the workbook itself. So those numbers will update at some point and the % in P28,P37 will not be 0% forever. When it becomes a number I want to include it in the average in P46, but when it is 0% I do not want it included in the average of those 4 numbers.

  19. #19
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Need Help with Average formula

    My formula should work with all you described --- unless there is a deviation from the string "% Avg of Twist Proj of Zone w/o G Bud" in the target cells. Is there? An extra space is all it would take.
    Last edited by FlameRetired; 06-26-2019 at 02:27 AM.

  20. #20
    Registered User
    Join Date
    06-25-2019
    Location
    Denver,CO
    MS-Off Ver
    2016
    Posts
    13

    Re: Need Help with Average formula

    Quote Originally Posted by FlameRetired View Post
    My formula should work with all you described --- unless there is a deviation from the string "% Avg of Twist Proj of Zone w/o G Bud" in the target cells. Is there? An extra space is all it would take.
    Would it not work if the P10,P19,P28,P37 are merged cells? They are currently P:Q merged...

    Other than that, everything is typed correctly... but it's just coming up 0.00

    this is the formula in P10 for example:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    I have the sheet name in O3,O12,O21,O30 and its pulling a percent that is calculated on each of those sheets from cell O3 on each sheet.
    Last edited by thatgreen; 06-26-2019 at 02:38 AM.

  21. #21
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Need Help with Average formula

    The formula you are currently trying --- can you copy/paste the whole thing in the next post?

  22. #22
    Registered User
    Join Date
    06-25-2019
    Location
    Denver,CO
    MS-Off Ver
    2016
    Posts
    13

    Re: Need Help with Average formula

    This is what I have in P46 using Ctrl+Shift+Enter

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

  23. #23
    Registered User
    Join Date
    06-25-2019
    Location
    Denver,CO
    MS-Off Ver
    2016
    Posts
    13

    Re: Need Help with Average formula

    Okay so I changed the formula to actually only go to P45 and now the cell says #VALUE! and when I check the function error this message appears... It says it! Just not in the cell??
    Attachment 629715

    NEVERMIND. Forgot to hit array again... WORKING!

  24. #24
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Need Help with Average formula

    There's the problem. You are entering the formula in the range you are referencing. P46 is in the range P1:P47. Try array entering it in P48.

    I need to turn in. It's past my bed time. I'll look at this again tomorrow if you haven't already solved it by then.
    Last edited by FlameRetired; 06-26-2019 at 02:51 AM.

  25. #25
    Registered User
    Join Date
    06-25-2019
    Location
    Denver,CO
    MS-Off Ver
    2016
    Posts
    13

    Re: Need Help with Average formula

    Quote Originally Posted by FlameRetired View Post
    There's the problem. You are entering the formula in the range you are referencing. P46 is in the range P1:P47. Try array entering it in P48.

    I need to turn in. It's past my bed time. I'll look at this again tomorrow if you haven't already solved it by then.
    It's working now. I myself and heading to bed. THANK YOU!!!

  26. #26
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Need Help with Average formula

    You are welcome. Glad you found solution.

+ 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] Average formula needed to get average data
    By wiewie002 in forum Excel General
    Replies: 3
    Last Post: 10-22-2018, 04:05 AM
  2. Replies: 5
    Last Post: 09-11-2018, 10:29 AM
  3. Replies: 2
    Last Post: 04-17-2018, 09:45 PM
  4. [SOLVED] Using the Average formula in VBA gives different results to worksheet Average formula
    By Sc0ut in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-06-2016, 06:02 AM
  5. [SOLVED] Average formula that shows 0 but does not count in average
    By Lewster in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 11-11-2015, 04:49 PM
  6. [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
  7. Replies: 0
    Last Post: 01-22-2013, 12:22 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