+ Reply to Thread
Results 1 to 7 of 7

Use asterisk with SUMIFS to ignore critieria when needed

  1. #1
    Registered User
    Join Date
    02-06-2013
    Location
    Israel
    MS-Off Ver
    Excel 2013/2016
    Posts
    3

    Use asterisk with SUMIFS to ignore critieria when needed

    Hello,

    I'm working on an spreadsheet where i want to filled values with dates and summarize it by specific dates.
    For example (Example file attached):
    In A column there will be dates: 1/1/2017, 1/2/2017, etc
    In B column there will be values: 95, 72, etc

    Now for the custom summarize function?
    in M3 there will be FROM DATE value: 1/1/2017
    In M4 there will be TO DATE value: 3/2/2017
    In M5 there will be my function:
    =SUMIFS(B:B,
    A:A,">="&M3,
    A:A,"<"&M4)

    Until here, it's all good.
    Problem is, i want to be able to tell my function to ignore this criteria in some cases. Like when i want summarize all values from 1/1/2017 until the end of time.
    So i want to be able to write asterisk in TO DATE cell (M5) and the SUMIFS function will calculate that everything is earlier than * and summarize all values.
    I know it can work with COUNTIFS function, but i can't get it work here.
    And i don't want to nest IFS, because in the original worksheet i have many criteria, and i don't want to getting lost in 8 rows formula...

    Do you have any idea what can i do?

    Thank you
    Attached Files Attached Files

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,378

    Re: Use asterisk with SUMIFS to ignore critieria when needed

    Hi Shaked and welcome to the forum,

    How about this in M5?

    =IF(OR(M3="",M4=""),SUM(B:B),(SUMIFS(B:B,A:A,">="&M3,A:A,"<="&M4)))
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    02-06-2013
    Location
    Israel
    MS-Off Ver
    Excel 2013/2016
    Posts
    3
    Hi Marvin,

    Thank you for your answer.
    Sure, that will work. But i wonder if there any way to do that without IF, from two reasons:
    1. I want this formula to be more flexiable, so i could enter only TO DATE, leave FROM DATE with asterix only, and get the sum of values just until the TO DATE, no matter from when.
    2. i've already have 4 IFS in the full formula and i really don't want to add another one...

    And again, thank you for your answer.

  4. #4
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Use asterisk with SUMIFS to ignore critieria when needed

    something like this?
    (2nd example is with DV)

    edit: I forgot, if you want ignore criteria simply delete dates from DV. If you want criteria again, select dates from DVs and add operators.
    Attached Files Attached Files
    Last edited by sandy666; 02-19-2017 at 06:02 PM. Reason: 2nd file added

  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,949

    Re: Use asterisk with SUMIFS to ignore critieria when needed

    Try

    =SUMPRODUCT((B2:B6)*(A2:A6>=IF(M3="*",DATE(2000,1,1),M3))*(A2:A6<=M4))

    Change default date if required

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

    Re: Use asterisk with SUMIFS to ignore critieria when needed

    Quote Originally Posted by shaked1988 View Post
    Hi Marvin,
    ..........................................

    2. i've already have 4 IFS in the full formula and i really don't want to add another one...

    And again, thank you for your answer.
    Perhaps if you uploaded an example with the multi-nested IF formula you currently have the solution would be to reduce the number other IFs?
    Dave

  7. #7
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,659

    Re: Use asterisk with SUMIFS to ignore critieria when needed

    Try:
    =SUMIFS(B:B,A:A,">="&IF(M3="*",1,M3),A:A,"<"&IF(M4="*",10^10,M4))
    Quang PT

+ 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. Numbers before 1st asterisk, 2nd asterisk, 3rd asterisk
    By stephme55 in forum Excel General
    Replies: 1
    Last Post: 08-23-2016, 12:57 AM
  2. [SOLVED] SUMIFS Formula - Ignore Criteria
    By idontexcelinexcel in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-27-2016, 09:50 PM
  3. [SOLVED] Exclude "begins with asterisk" in a sumifs formula
    By rs1aj in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-16-2016, 04:06 PM
  4. Replies: 1
    Last Post: 09-09-2014, 10:47 AM
  5. [SOLVED] SUMIFS Formula: Can it ignore a Blank Criteria field?
    By mlj61289 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-17-2013, 12:43 PM
  6. Replies: 7
    Last Post: 12-16-2011, 11:31 AM
  7. SUMIFS asterisk on numbers doesn't work
    By n748 in forum Excel General
    Replies: 3
    Last Post: 06-30-2010, 07:49 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