+ Reply to Thread
Results 1 to 12 of 12

How to exclude the text value in Average Function??

  1. #1
    Registered User
    Join Date
    03-21-2013
    Location
    Hong Kong SAR
    MS-Off Ver
    Excel 2010
    Posts
    13

    How to exclude the text value in Average Function??

    I try to use the Average function in my spreadsheet.
    And I find that it includes the text in the first row automatically. How can I exclude it?
    Average.xlsm

    In the Sheet"ProcessTable", Range "J11" The average will be Average(E1:E11) , but you can notice that E1 is "Close" instead of an numerical value.

    How can I solve this?

    Thanks.

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: How to exclude the text value in Average Function??

    but you can notice that E1 is "Close" instead of an numerical value.
    E1 will be "Close" only because it is an value hard coded (entered manually).. I am not able to understand what you are looking for ? thanks.


    Regards,
    DILIPandey
    <click on below * if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

  3. #3
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: How to exclude the text value in Average Function??

    Using your posted workbook...
    Try something like this:
    J2:
    Please Login or Register  to view this content.
    Copy that formula down as far as you need.

    Is that something you can work with?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  4. #4
    Registered User
    Join Date
    03-21-2013
    Location
    Hong Kong SAR
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: How to exclude the text value in Average Function??

    Yes, this is what i need!
    And could you explain how the Row() function works?

  5. #5
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: How to exclude the text value in Average Function??

    In this formula: =IFERROR(IF(AND($E2>0,ROW()>UserInput!$E$10),AVERAGE($E2:OFFSET($E2,,,-UserInput!$E$10,)),""),)

    This section AND($E2>0,ROW()>UserInput!$E$10) determines if
    1) the E2 value is greater than zero
    AND
    2) the current row number is greater than the number of cells we want to average.
    Effectively making sure we only calculate if we have the minimum number of values we want to average.

    If your headings were on Row_4, the formula could be adjusted to this:
    =IFERROR(IF(AND($E4>0,(ROW()-ROW($J$3))>=UserInput!$E$10),AVERAGE($E4:OFFSET($E4,,,-UserInput!$E$10,)),""),)

  6. #6
    Registered User
    Join Date
    03-21-2013
    Location
    Hong Kong SAR
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: How to exclude the text value in Average Function??

    Clear and accurate answer! ThankS a lot sir

  7. #7
    Registered User
    Join Date
    03-21-2013
    Location
    Hong Kong SAR
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: How to exclude the text value in Average Function??

    One more question.

    When I calculating 3 SMAs, the second and the third one will be affected by the first one.
    I used the formula you amended, Why would it happen?

    thanks
    Attached Files Attached Files

  8. #8
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: How to exclude the text value in Average Function??

    Each column's formula needs to reference the input cell that affects it:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Does that help?

  9. #9
    Registered User
    Join Date
    03-21-2013
    Location
    Hong Kong SAR
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: How to exclude the text value in Average Function??

    Yes. I just omitted to change the first E10. Thank you for you help

  10. #10
    Registered User
    Join Date
    03-21-2013
    Location
    Hong Kong SAR
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: How to exclude the text value in Average Function??

    One more question.

    I have made a sub, which calculate the mean deviation (Column Q)
    The mean deviation is "SMA of Typical Price(Column P )" minus "Typical Price(Column H). the Rane is according to the CCIday which is located in Sheet(UserInput) B10
    For example, =abs(P4-H4)+abs(P4-H3)+abs(P4-H2) if the4 CCIday is "3"

    Could you please tell How can i code it for calculation?

    Again, many thanks
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    03-21-2013
    Location
    Hong Kong SAR
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: How to exclude the text value in Average Function??

    Anyone could help me to solve this?

  12. #12
    Registered User
    Join Date
    03-21-2013
    Location
    Hong Kong SAR
    MS-Off Ver
    Excel 2010
    Posts
    13

    Re: How to exclude the text value in Average Function??

    Please help me to solve this.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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