+ Reply to Thread
Results 1 to 8 of 8

"Average" shortcut

  1. #1
    Registered User
    Join Date
    03-04-2010
    Location
    North Hampton, NH
    MS-Off Ver
    Excel 2003
    Posts
    1

    "Average" shortcut

    I know that the sum function shortcut key is Alt + =, but is there a similar shortcut for the average function? If not, is there an easy way to create one? Thank you.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,995

    Re: "Average" shortcut

    Well, the ALT+= shortcut is not exactly for the function, it's for the autosum button, which happens to populate the cell with the function SUM. There is a subtle difference. There are not shortcuts for functions as such.

    I thought it would be straightforward to write a macro that would do what you want, then assign a shortcut key to it, but when I run the macro the line
    Please Login or Register  to view this content.
    generates an error (1004, application-defined or object-defined error). I suspect that VBA might not be allowed to insert a function that a user would not be able to legally insert (i.e., AVERAGE without its arguments).

    So I don't know of any way to do this.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887

    Re: "Average" shortcut

    It's "reasonably" straight forward to do this..

    In your ThisWorkbook's Workbook_Open event, paste the following code:
    Please Login or Register  to view this content.
    Then insert a standard module and paste this code:
    Please Login or Register  to view this content.
    Finally, in the Workbook_BeforeClose event, add this to reset the key combo to nothing:
    Please Login or Register  to view this content.
    Save and close, then re-open the workbook. (Or, just run the workbook_open event manually from the vb editor to set that key combination.)

    Now when you press ALT+- (ALT and minus) it will insert the AVERAGE function the same way that the autosum button works. It stops at any blank cell it encounters, just like the autosum function.

  4. #4
    Registered User
    Join Date
    09-27-2012
    Location
    Florida, USA
    MS-Off Ver
    Excel 2007
    Posts
    48

    Re: "Average" shortcut

    Just like the ALT+= inserts =sum(), ALT+MUA (ALT+M opens the formula ribbon, U opens the dropdown for autosum, A selects Average) inserts =average().

  5. #5
    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
    53,049

    Re: "Average" shortcut

    Don, that is a really great tip to remember :")

    (however, this thread is almosr 4 years old, I doubt they are still monitoring it)
    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

  6. #6
    Registered User
    Join Date
    09-27-2012
    Location
    Florida, USA
    MS-Off Ver
    Excel 2007
    Posts
    48

    Re: "Average" shortcut

    Thanks and you are probably quite right. Have a great weekend FDibbins.

  7. #7
    Registered User
    Join Date
    04-24-2023
    Location
    Texas
    MS-Off Ver
    365
    Posts
    1

    Re: "Average" shortcut

    Trying to do this in 2013...

  8. #8
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,995

    Re: "Average" shortcut

    Welcome to the Forum stinkycat!

    Administrative Note:

    We are happy to help, however while you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original. Also, this thread was started 13 years ago.

    Please see Forum Rule #4 about hijacking and start a new thread for your query.

    If you are not familiar with how to start a new thread see the FAQ: How to start a new thread

    As a new member, please take the time to review our rules. There aren't many, and they are all important.

+ 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