+ Reply to Thread
Results 1 to 6 of 6

Average if cells are duplicates

  1. #1
    Registered User
    Join Date
    01-06-2022
    Location
    Netherlands
    MS-Off Ver
    Microsoft® Excel® for Microsoft 365 MSO (Version 2111 Build 16.0.14701.20254) 64-bit
    Posts
    3

    Average if cells are duplicates

    Hi,

    I have data based on zipcodes and these zipcodes fall into larger area codes. I would like to have this data as an average for each area. Basically I want all my data in new columns if areacodes match. I already have a seperate column for all the unique areacode used in my research. Presumably I would use the 'averageif' function but I do not know how to write that I want duplicates to average as a criterea. In the attachment I have made an example of what I need. What is the best way to get this average data in column 'H' and 'I' in my example?
    Attached Images Attached Images
    Last edited by MarkGarth; 01-08-2022 at 04:54 AM. Reason: Solved

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

    Re: Average if cells are duplicates

    Welcome to the forum.

    There are instructions at the top of the page explaining how to attach your sample workbook.

    A good sample workbook has just 10-20 rows of representative data that has been desensitised. It also has expected results mocked up, relevant cells highlighted and a few explanatory notes.

    How are you defining 'duplicates'? I see no duplicates in your sample.

    Maybe in H2 copied across and down?

    =AVERAGEIFS(C$2:C$10,$B$2:$B$10,$G2)

    Or, for your locale:

    =AVERAGEIFS(C$2:C$10;$B$2:$B$10;$G2)
    Last edited by AliGW; 01-08-2022 at 04:40 AM.
    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.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    01-06-2022
    Location
    Netherlands
    MS-Off Ver
    Microsoft® Excel® for Microsoft 365 MSO (Version 2111 Build 16.0.14701.20254) 64-bit
    Posts
    3

    Re: Average if cells are duplicates

    Thank you for your time and response. The duplicates are in column B. I would like to have the average distance (column C) and average distance (column D) for areacode A, B, and C presented in column H and I respectively.

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

    Re: Average if cells are duplicates

    So what was wrong with my suggestion, then? Did you try it?

    Those are not duplicates, really - duplicates would be rows (records) where all columns (fields) were the same.

    If my suggestion doesn't work for you, attach a workbook showing the issue.

  5. #5
    Registered User
    Join Date
    01-06-2022
    Location
    Netherlands
    MS-Off Ver
    Microsoft® Excel® for Microsoft 365 MSO (Version 2111 Build 16.0.14701.20254) 64-bit
    Posts
    3

    Re: Average if cells are duplicates

    Your suggestion works! Thank you very much and have a great day!

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,417

    Re: Average if cells are duplicates

    If that takes care of your original question, please select 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 those who have helped you by clicking the small star icon 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 all 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. [SOLVED] Taking the average of multiple groups of cells with ability to extend range of average
    By 2597Gar in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-29-2019, 11:07 AM
  2. [SOLVED] Macro to find duplicates, concatenate cells, then delete old duplicates (2)
    By cny in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-22-2016, 06:05 AM
  3. Macro to find duplicates, concatenate cells, then delete old duplicates
    By givemepuppies in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 03-04-2016, 02:43 AM
  4. Average duplicates
    By kraut in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 01-02-2014, 06:55 PM
  5. VBA Macro to Calculate Average excluding Duplicates
    By dani_n88 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-04-2012, 07:55 PM
  6. [SOLVED] Average only the 1st item when there are duplicates in a list
    By JungleJme in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-08-2012, 06:18 AM
  7. [SOLVED] Need Assistance: Average/Remove Duplicates
    By DigitalGM in forum Excel General
    Replies: 3
    Last Post: 06-22-2005, 08:05 PM

Tags for this Thread

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