+ Reply to Thread
Results 1 to 8 of 8

SUMIFS with Max

  1. #1
    Registered User
    Join Date
    12-21-2012
    Location
    oxford
    MS-Off Ver
    MS-Off 2010 & 2016
    Posts
    16

    SUMIFS with Max

    Hi All

    Im trying to build a report for our operations team and have come up short on 1 column of data... I am trying to utilise SUMFS to establish a financial value based on criteria from multiple columns this i can do.

    The formula sums the all values that meet the criteria (ie £7000) however i wish to only sum/return the max value (ie £3000)

    So far i have

    =MAX(SUMIFS('Sheet2'!E:E,'Sheet2'!A:A,C2,'Sheet2'!B:B,D2))


    Destination Table

    C D E F
    Hotel l Room l Booking l Value
    ==================================
    Hotel 1 l Deluxe Room l Period A l xxxxxx


    Source Sheet2

    A B C D
    Hotel l Room l Booking l Value
    ==================================
    Hotel 1 l Deluxe Room l Period A l £1000
    Hotel 1 l Deluxe Room l Period A l £1000
    Hotel 1 l Deluxe Room l Period B l £2000
    Hotel 1 l Deluxe Room l Period C l £3000

    Can you awesome folk at ExcelForum's help?

    Many Thanks

    Liam

  2. #2
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: SUMIFS with Max

    your request is a little vague. it sounds like you are looking to count the number of values that are at £3000?
    or are you looking to sum all the items in col D where it equals £3000?
    if so then I would think this...
    =SUMIFS('Sheet2'!D:D,'Sheet2'!D:D,3000,'Sheet2'!A:A,C2,'Sheet2'!B:B,D2) though I don't know what is in C2 and D2. But that would give you the sum of all the items in col D equaling £3000.

    or are you looking to limit the sum to a max of 3000?
    then this instead...
    =SUMIFS('Sheet2'!D:D,'Sheet2'!D:D,"<="&3000,'Sheet2'!A:A,C2,'Sheet2'!B:B,D2)
    Last edited by Sam Capricci; 11-28-2018 at 01:45 PM.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    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
    52,933

    Re: SUMIFS with Max

    Agree your request is a bit vague

    What your formula is currently doing, is summing all data based on your criteria - which will give you a number, then finding the max of that same number - which will be THAT number

    Perhaps you could upload a small (clean) sample workbook (not a pic) of what you are working with, and what your expected outcome would look like.
    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

  4. #4
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: SUMIFS with Max

    Or perhaps ...
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    In the meantime I'll wait for the upload.
    Dave

  5. #5
    Registered User
    Join Date
    12-21-2012
    Location
    oxford
    MS-Off Ver
    MS-Off 2010 & 2016
    Posts
    16

    Re: SUMIFS with Max

    sorry guys, i will expand the data set, perhaps that will make things clearer.

    the attachment shows on the Source Sheet

    the complex
    the room types within that complex
    the period of the stay
    the number rooms of that room type
    the total amount due if all rooms are booked out

    because these rooms can been booked out at different periods lengths this provides different rates or that room type.

    i am trying to establish the maximum potential rent should the room be booked out at the maximum rate.

    in the case of complex 1 this is simple as there is only 1 period of stay, in the case of complex 2 there are 2 periods of stay at different total amounts

    i wish to present the maximum of the 2 in my report, this report with us SUMIFS to validate Using the complex name and room type.

    i hope this suits as a better description and apologies for missing the mark there
    Attached Files Attached Files

  6. #6
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: SUMIFS with Max

    I am still not certain I understand. Judging from the layout and stated intent this seemed reasonable. In 'Result' D2 and filled down.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  7. #7
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: SUMIFS with Max

    Maybe
    D2
    =MAX(INDEX(Source!$E$2:$E$15*(Source!$B$2:$B$15=B2)*(Source!$D$2:$D$15=C2),))

  8. #8
    Registered User
    Join Date
    12-21-2012
    Location
    oxford
    MS-Off Ver
    MS-Off 2010 & 2016
    Posts
    16

    Re: SUMIFS with Max

    Thank you FlameRetired and Bo_Ry

    To clarify based on the sample data attached earlier and using the Classic Studio as an example Room Type and for those searching for an answer!!!

    Complex 2 has 2 Booking Types, each charging a different Rent (shown below)

    31/08/2019 - 21/08/2020 51w - £518,160.00
    07/09/2019 - 03/07/2020 43w - £500,200.00

    If i was to use a SUMIFS it would sum the 2 together giving me a value of £1,018,360.00, this is not what im trying to achieve.

    I need to show the max value.... in this case £518,160.00.

    Bo_Ry, i tried your MAX, INDEX and MATCH, at first i looked at a full range and this returned #VALUE however once i changed it to look at a specific range i was not disappointed.

    Thank you Bo_Ry

+ 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. Replies: 0
    Last Post: 08-22-2017, 03:49 PM
  2. [SOLVED] Sumifs formula without using sumifs....
    By blockbyblock in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-10-2017, 10:45 AM
  3. [SOLVED] If no SUMIFS matches, 1, otherwise the SUMIFS result...
    By JYTS in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-04-2016, 07:39 PM
  4. sumifs vs. Application.WorksheetFunction.SumIfs
    By flooyd in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-01-2016, 11:22 AM
  5. [SOLVED] Looking for something simpler than SUMIFS - SUMIFS
    By YAbdelaal in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-27-2014, 10:38 AM
  6. SUMIFS Puzzle - Trying to avoid adding multiple SUMIFS to get valid result
    By haldavid in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-09-2013, 03:42 PM
  7. [SOLVED] Sumifs, problem with the formula: =sumifs(c10:c200,<=today(),0)
    By Faustocruz in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-08-2012, 04:26 AM

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