+ Reply to Thread
Results 1 to 4 of 4

Average of two columns with common elements

Hybrid View

  1. #1
    Registered User
    Join Date
    11-09-2023
    Location
    iran
    MS-Off Ver
    2016
    Posts
    5

    Average of two columns with common elements

    Is there a way to calculate the average of each column only for the rows of the columns that have both numbers? For example, if A5 and B5 have numbers, they will be calculated in calculating the average of their columns, but if, for example, A5 has numbers but B5 is empty, they will not be used in calculating the average in both columns. for example, in the picture below, I only want rows 2, 7, 9, 10, 12, 13, 15, 17 to be calculated for column A and column B.
    question.PNG

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    91,087

    Re: Average of two columns with common elements

    Welcome to the forum.

    Yes. Try this for column A:

    =AVERAGEIFS(A1:A17,A1:A17,"<>",B1:B17,"<>")

    and for column B:

    =AVERAGEIFS(B1:B17,A1:A17,"<>",B1:B17,"<>")
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    11-09-2023
    Location
    iran
    MS-Off Ver
    2016
    Posts
    5

    Re: Average of two columns with common elements

    Thank you very much, the formula is very good, I had another question, how can I expand this formula for more columns? For example, for ten columns whose rows have numbers. When I drag the formula, the second part of the formula changes, while I want that part of the formula to be fixed

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    91,087

    Re: Average of two columns with common elements

    Just look the lookup ranges:

    =AVERAGEIFS(A1:A17,$A1:$A17,"<>",$B1:$B17,"<>")

    Glad to have helped.

    If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, if you have not already done so, you may not be aware that you can thank anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of each of those who offered help.

+ 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. Pulling different numbers from arrays with elements in common
    By MrBlonde_ in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-21-2023, 07:42 AM
  2. Pulling different numbers from arrays with elements in common
    By MrBlonde_ in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-20-2023, 10:06 PM
  3. Pulling different numbers from arrays with elements in common
    By MrBlonde_ in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-20-2023, 11:39 AM
  4. Count common elements of three columns
    By aasulman in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-18-2022, 03:57 PM
  5. [SOLVED] Find Number of Common elements from two groups.
    By aasulman in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-28-2020, 06:00 AM
  6. extract unique and common elements from cells
    By loup29 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-19-2017, 10:06 PM
  7. Replies: 1
    Last Post: 08-24-2017, 04:56 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