+ Reply to Thread
Results 1 to 3 of 3

Find average value and rank based on multiple criteria within same columns

  1. #1
    Registered User
    Join Date
    05-15-2023
    Location
    Philadelphia, United States
    MS-Off Ver
    2208
    Posts
    7

    Find average value and rank based on multiple criteria within same columns

    I have a sample dataset of a few stores located within their districts and sales attributed to them. I want to create two new columns 'Avg_District_Sales', which calculates the avg sales of each stores within its district and for both the years separately and 'Store_District_Rank', which ranks the stores based on the value of sales within its district and for both the years separately. For example, in the attached sample dataset, stores 101, 105, and 106 belong to district 1, so for each of these stores, 'Avg_District_Sales' column will perform an average of their sales, i.e., 459, 779, 540 and display 592.6 against each of these stores for the year 2022. It would do the same for year 2023. Store district rank will also be calculated on the same concept. I'm aware of averageifs() function but I'm not sure how can I use it to display the values against each store.

    The yellow highlighted columns in the attached sample workbook are my desired columns that I need to calculate.
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,913

    Re: Find average value and rank based on multiple criteria within same columns

    Try this in E2:

    =AVERAGEIFS($D$2:$D$17,$A$2:$A$17,A2,$C$2:$C$17,C2)

    in F2:

    =COUNTIFS($A$2:$A$17,A2,$C$2:$C$17,C2,$D$2:$D$17,">"&D2)+1

  3. #3
    Registered User
    Join Date
    05-15-2023
    Location
    Philadelphia, United States
    MS-Off Ver
    2208
    Posts
    7

    Re: Find average value and rank based on multiple criteria within same columns

    Works perfectly! Thank you

+ 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] Cannot find Max/Min/Average based on multiple criteria
    By EXcelForumGuy in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 01-05-2023, 04:22 PM
  2. Find Average Difference of 2 Columns Based on Criteria from 2 Other Columns
    By davidcato in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-17-2022, 08:47 AM
  3. [SOLVED] Average Based on Multiple Criteria in Same and Different Columns
    By KoolKatelyn in forum Excel Formulas & Functions
    Replies: 28
    Last Post: 02-20-2018, 02:15 PM
  4. Replies: 4
    Last Post: 07-13-2017, 05:45 PM
  5. Replies: 1
    Last Post: 02-15-2016, 04:35 PM
  6. Trying to find median & average for multiple columns with multiple criteria
    By help-meplease in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-11-2016, 06:59 PM
  7. [SOLVED] Average Based on Criteria in Multiple Columns
    By sinspawn56 in forum Excel General
    Replies: 2
    Last Post: 07-31-2012, 01:27 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