+ Reply to Thread
Results 1 to 19 of 19

Can you do a MedianIF Statment like a sumIF?

  1. #1
    Registered User
    Join Date
    08-21-2019
    Location
    Camden, OH
    MS-Off Ver
    MS Excel 2016 (16.0.5400.1000) MSO (16.0.5393.1000) 32-bit
    Posts
    50

    Can you do a MedianIF Statment like a sumIF?

    I need a calulation for a Median, based on another Columns result, is that possible?

  2. #2
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,465

    Re: Can you do a MedianIF Statment like a sumIF?

    Please attach a sample workbook and what is the expected result?

  3. #3
    Registered User
    Join Date
    08-21-2019
    Location
    Camden, OH
    MS-Off Ver
    MS Excel 2016 (16.0.5400.1000) MSO (16.0.5393.1000) 32-bit
    Posts
    50

    Re: Can you do a MedianIF Statment like a sumIF?

    State Calc.xlsx

    These a 2 small Areas which are separated by the Column C - the entire spread sheet has several hundred appraisal areas with differing row counts

    I need the Calculations in Rows 8-13 to be inline within Each row Based on the Col C. Notice that Columns H's Calc depends on the Median of the Ratios of Col C's Appr_Area. You get the picture!!
    Last edited by BigDaddyDoty; 06-26-2023 at 09:20 AM.

  4. #4
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,465

    Re: Can you do a MedianIF Statment like a sumIF?

    No I don't get the picture.
    I don't see manually added epected results whith an explanation.
    I need to know what results you expect where.

  5. #5
    Registered User
    Join Date
    08-21-2019
    Location
    Camden, OH
    MS-Off Ver
    MS Excel 2016 (16.0.5400.1000) MSO (16.0.5393.1000) 32-bit
    Posts
    50

    Re: Can you do a MedianIF Statment like a sumIF?

    What I am looking for is the Calculations in F8 to G13 & N8 to O13 the ones in (RED) to be calculated in each row. The Median Calculation should only calculate the Median value for Each Change in Col C or for each individual Appr_Area. If you look at the RED formulas should kind of explain it. The entire Sheet has Hundreds of individual Appr_Areas the contend with. Normally you could do a sumIF but I couldn't find a MedianIF statement to Calculate Col H with.

    Should kinda look like this:

    Capture.PNG

    Does that help?

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,139

    Re: Can you do a MedianIF Statment like a sumIF?

    Why does the calculation of PRD differ between the first column set and the second column set?

    G11:
    =AVERAGE(FILTER(G$2:G11,($A$2:$A11<>"")*($C$2:$C11=LOOKUP(2,1/($C$2:$C11<>""),$C$2:$C11))))

    G12:
    =MEDIAN(FILTER(G$2:G12,($A$2:$A12<>"")*($C$2:$C12=LOOKUP(2,1/($C$2:$C12<>""),$C$2:$C12))))

    Select F9 to G13... copy DOWN.

    O11:
    =AVERAGE(FILTER(O$2:O11,($A$2:$A11<>"")*($C$2:$C11=LOOKUP(2,1/($C$2:$C11<>""),$C$2:$C11))))

    O12:

    =MEDIAN(FILTER(O$2:O11,($A$2:$A11<>"")*($C$2:$C11=LOOKUP(2,1/($C$2:$C11<>""),$C$2:$C11))))

    again, select the relevant block and copy DOWN.
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  7. #7
    Registered User
    Join Date
    08-21-2019
    Location
    Camden, OH
    MS-Off Ver
    MS Excel 2016 (16.0.5400.1000) MSO (16.0.5393.1000) 32-bit
    Posts
    50

    Re: Can you do a MedianIF Statment like a sumIF?

    Why does the calculation of PRD differ between the first column set and the second column set?

    They are calculated of of the Differing Weighed Avg Values between the Original Total Cost and the Adjusted Total Cost. So the Median Calc for each Appr_area needs to be imbedded into the Calculation in Colum H. The Ratio Calculation s are (Sale_Amount/Total Cost (F/M)) & (Sale_Amount/Adj Val) (F/N))

  8. #8
    Registered User
    Join Date
    08-21-2019
    Location
    Camden, OH
    MS-Off Ver
    MS Excel 2016 (16.0.5400.1000) MSO (16.0.5393.1000) 32-bit
    Posts
    50

    Re: Can you do a MedianIF Statment like a sumIF?

    Needs to be like this

    State Calc.xlsx

  9. #9
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,139

    Re: Can you do a MedianIF Statment like a sumIF?

    Upload a file showing what you have and what you want and NOTHING else.

  10. #10
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,465

    Re: Can you do a MedianIF Statment like a sumIF?

    I don't still see manually added epected results of a formula, so I still don't understand what the formula should do.

    Please Login or Register  to view this content.
    There does not exists a MEDIANIF, but in 365 its easy to create your onwn MEDIANIF with MEDIAN(FILTER
    For exmaple =MEDIANIF (<Criteria range>,<criteria>,<Median range>) =MEDIANIF(A1:A99,12345,B1:B99) ==> MEDIAN(FILTER(B1:B99,A1:A99=12345))
    Last edited by HansDouwe; 06-26-2023 at 01:48 PM.

  11. #11
    Registered User
    Join Date
    08-21-2019
    Location
    Camden, OH
    MS-Off Ver
    MS Excel 2016 (16.0.5400.1000) MSO (16.0.5393.1000) 32-bit
    Posts
    50

    Re: Can you do a MedianIF Statment like a sumIF?

    State Calc.xlsx

    Does this help?

  12. #12
    Forum Expert
    Join Date
    09-25-2015
    Location
    Milan Italy
    MS-Off Ver
    office 365
    Posts
    1,790

    Re: Can you do a MedianIF Statment like a sumIF?

    N3=IF(COUNTIF($E$3:E3,E3)=COUNTIF($E$3:$E$38,E3),AGGREGATE(16,6,$M$3:$M$38/($E$3:$E$38=E3),0.5),"")

    Copy down

  13. #13
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,465

    Re: Can you do a MedianIF Statment like a sumIF?

    Orginal mean, please try in V3 and copy down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Orginal median, please try in W3 and copy down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Adjusted mean, please try in AE3 and copy down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Adjusted median, please try in AF3 and copy down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    08-21-2019
    Location
    Camden, OH
    MS-Off Ver
    MS Excel 2016 (16.0.5400.1000) MSO (16.0.5393.1000) 32-bit
    Posts
    50

    Re: Can you do a MedianIF Statment like a sumIF?

    Is there an addon to make the Filter command Work? I get a #NAME? error if I change anything in the Spreadsheet

  15. #15
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,465

    Re: Can you do a MedianIF Statment like a sumIF?

    Filter, works in Excel 2021 and Excel 365 only.
    If you get #Name you are using an older Excel Version.

    If your MS-Off Ver. in your profile (Office 365) is correct it should work.

  16. #16
    Registered User
    Join Date
    08-21-2019
    Location
    Camden, OH
    MS-Off Ver
    MS Excel 2016 (16.0.5400.1000) MSO (16.0.5393.1000) 32-bit
    Posts
    50

    Re: Can you do a MedianIF Statment like a sumIF?

    I have 365 on my personal stuff, but not my work PC

    MS Excel 2016 (16.0.5400.1000) MSO (16.0.5393.1000) 32-bit

  17. #17
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,465

    Re: Can you do a MedianIF Statment like a sumIF?

    In that case the formula will work on your personal stuff, but not on your work PC.

    We provide solutions for the MS-Office version that you indicate in your profile.
    If you need a solution for a different version or MS-Office, adjust your profile or indicate this very explicitly in your opening post.

  18. #18
    Registered User
    Join Date
    08-21-2019
    Location
    Camden, OH
    MS-Off Ver
    MS Excel 2016 (16.0.5400.1000) MSO (16.0.5393.1000) 32-bit
    Posts
    50

    Re: Can you do a MedianIF Statment like a sumIF?

    I updated my version to work version, do I have to start a new thread? Or will this suffice?

  19. #19
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,465

    Re: Can you do a MedianIF Statment like a sumIF?

    Thanks, this will suffice.

    This formula should work in Excel 2016:

    Orginal median: Please try in W3 and copy down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    and adjusted median: Please try in AF3 and copy down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by HansDouwe; 06-26-2023 at 03:37 PM.

+ 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] For Next Loop with an if statment (or replacing an if statment ?)
    By MikeGee in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-30-2020, 01:55 PM
  2. SumIF and MedianIF Help
    By csnyder10 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-27-2016, 05:17 PM
  3. Problem with SUMIF() with AND() statment as criteria
    By castled in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 06-25-2015, 12:35 PM
  4. Replies: 2
    Last Post: 06-06-2012, 10:59 PM
  5. MedianIf... using Lookup?
    By lady_Jane in forum Excel General
    Replies: 2
    Last Post: 07-05-2011, 11:50 AM
  6. Breaking down a SUMIF statment
    By LAF in forum Excel General
    Replies: 4
    Last Post: 03-02-2010, 05:45 PM
  7. MedianIf?
    By ameng in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-02-2006, 04:25 PM

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