+ Reply to Thread
Results 1 to 8 of 8

Shorten a SUMIF formula

Hybrid View

  1. #1
    Registered User
    Join Date
    05-23-2013
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    46

    Shorten a SUMIF formula

    Hi,

    I need help in shortening my formula as it will exceed the 8192 characters.

    Below is my formula:

    =SUMIFS('Data Dump'!$L$4:$L$99987,'Data Dump'!$L$4:$L$99987,">=1",'Data Dump'!$F$4:$F$99987,">="&DAR!$G12,'Data Dump'!$F$4:$F$99987,"<="&DAR!$H12,'Data Dump'!$H$4:$H$99987,$DA12,'Data Dump'!$D$4:$D$99987,">="&DAR!$J12,'Data Dump'!$E$4:$E$99987,"<="&DAR!$K12,'Data Dump'!$B$4:$B$99987,$DF12)


    However, I need to add aside from $DF12 to include as well $DG12 and $DH12, afterwards change $DA12 to $DB12, $DC12

    My original formula have 9 combinations of above formula which is too long.

    Each DA column will add DF, DG, DH
    Each DB column will add DF, DG, DH
    and so on.

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Shorten a SUMIF formula

    Maybe you need to change the data (e.g. in a vertically way), so you could use a pivot table.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Registered User
    Join Date
    05-23-2013
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    46

    Re: Shorten a SUMIF formula

    I can't as I need to put new set of data vertically

  4. #4
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Shorten a SUMIF formula

    Probably it can be done with VBA. (maybe not by me).

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,905

    Re: Shorten a SUMIF formula

    Perhaps post a sample file so we can see what you are doing as it seems (is!) a very complex summation.

    And VBA may be the (only?) answer.

  6. #6
    Registered User
    Join Date
    05-23-2013
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    46

    Re: Shorten a SUMIF formula

    Maybe it will help if I will describe my spreadsheet.

    I have two spreadsheets.

    Spreadsheet 1: "Data Dump" is where I paste all my data pulled out from our system. Example: all the sales we have for the financial year 2015-2016

    Column L: list the number of nights sold
    Culumn F: booking date
    Column H: is rate code
    Column D: is arrival date
    Column E: is departure date
    Column B: is room type

    Spreadsheet 2: "DAR1516" is where I summarize the data based on the sale as we have different promos
    Column G is sale start
    Column H is sale end
    Column J is travel start
    Column K is travel end
    Column DA-DE is the different rate code that makes up a sale
    Column DF-DL is the different room type that is included in the sale

    what i wanted is that in I want to add the no of nights (sheet1, column L) that is

    1. booked (sheet1, column f) between the sale period (sheet 2, column G & H)
    2. arrival and check-in date is between the travel period (sheet 2, column J & K)
    3. that adds up all the rate plan in the sale (sheet 2, DA and/or DB, and/or DC, and/or DD, and/or DE)
    4 that adds up all the room type (sheet 2, DF and/or DG,and/or DH, and/or, DI, and/or DJ, and/or DK, and/or DL)

    Hope above makes more sense.

    thanks

  7. #7
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,905

    Re: Shorten a SUMIF formula

    A file would still help: no one wants to type in data to test any formulae.

    And reading your description, I am not sure I follow the logic: you appear to have "ad hoc" mixture of dates, rates and room types: I suspect SUMPRODUCT is maybe what you need.
    Last edited by JohnTopley; 12-06-2015 at 03:41 PM.

  8. #8
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,426

    Re: Shorten a SUMIF formula

    If the long composite formula is going to be too long, why don't you put the shorter formulae in separate columns (which could be hidden), and then sum the results from those columns?

    Hope this helps.

    Pete

+ 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. Shorten formula?
    By jw01 in forum Excel General
    Replies: 1
    Last Post: 06-08-2015, 04:55 PM
  2. [SOLVED] How to shorten If formula?
    By mso3 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-03-2014, 01:01 AM
  3. [SOLVED] Shorten SUMIF + SUMIF + SUMIF each with same reference range but different criteria???
    By HeyInKy in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-13-2014, 09:25 PM
  4. Shorten This Formula
    By excelforum123 in forum Excel General
    Replies: 3
    Last Post: 10-12-2010, 05:11 AM
  5. Shorten Formula
    By jmhunt83 in forum Excel General
    Replies: 1
    Last Post: 10-07-2010, 03:34 PM
  6. Shorten Formula
    By GTVT06 in forum Excel General
    Replies: 10
    Last Post: 07-24-2006, 02:10 PM
  7. Shorten an IF formula
    By Joker in forum Excel General
    Replies: 4
    Last Post: 12-10-2005, 08:35 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