+ Reply to Thread
Results 1 to 6 of 6

Display value if criteria is met & specific period of time

  1. #1
    Registered User
    Join Date
    02-15-2024
    Location
    Andorra
    MS-Off Ver
    365
    Posts
    7

    Display value if criteria is met & specific period of time

    Hello!

    I am struggling with something that will be easy to solve by most of you, the issue is the following:

    I want to display total amount of values (in this example, customers (N5) if criteria (Tag) is met (column (O5)), and during a specific period of time (P5).

    Let's say I want to get the total amount of customers with "Blue Tag" during January (1/1/24 - 31/1/24) including both days, which formula should be set on "C8"?

    File attached.

    Thanks,
    Attached Files Attached Files

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,887

    Re: Display value if criteria is met & specific period of time

    With Power Query, you can count the number of customers by tag and month/year.

    Please Login or Register  to view this content.
    Excel 2016 (Windows) 64 bit
    E
    F
    G
    6
    Tag Month:Year Count
    7
    GREEN February:2024
    1
    8
    BLUE January:2024
    3
    9
    BLACK January:2024
    1
    10
    GREEN December:2023
    1
    11
    GREEN October:2023
    1
    12
    BLUE December:2023
    1
    Sheet: Test

    Power Query is a free AddIn for Excel 2010 and 2013, and is built-in functionality from Excel 2016 onwards (where it is referred to as "Get & Transform Data").

    It is a powerful yet simple way of getting, changing and using data from a broad variety of sources, creating steps which may be easily repeated and refreshed. I strongly recommend learning how to use Power Query - it's among the most powerful functionalities of Excel.

    - Follow this link to learn how to install Power Query in Excel 2010 / 2013.

    - Follow this link for an introduction to Power Query functionality.

    - Follow this link for a video which demonstrates how to use Power Query code provided.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    02-12-2024
    Location
    Australia
    MS-Off Ver
    365
    Posts
    9

    Re: Display value if criteria is met & specific period of time

    or without a PQ;

    =COUNTIFS($O$6:$O$13,$C$6, $P$6:$P$13,">="&$C$4, $P$6:$P$13, "<" & EDATE($C$4,1))

  4. #4
    Registered User
    Join Date
    02-15-2024
    Location
    Andorra
    MS-Off Ver
    365
    Posts
    7

    Re: Display value if criteria is met & specific period of time

    Thank you for your help, but I made a mistake when explained what I am actually trying to get.

    I said total amount of customers (both of your suggestions work fine here) but what I really want is to display all these customer names starting on "C8".

    Thanks,

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,861

    Re: Display value if criteria is met & specific period of time

    In C8:

    =FILTER(Table1[Customer],(Table1[Tag]=C6)*(Table1[Date]>=$C$4)*(Table1[Date]<EDATE($C$4,1)))
    Attached Files Attached Files
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  6. #6
    Registered User
    Join Date
    02-15-2024
    Location
    Andorra
    MS-Off Ver
    365
    Posts
    7

    Re: Display value if criteria is met & specific period of time

    Quote Originally Posted by AliGW View Post
    In C8:

    =FILTER(Table1[Customer],(Table1[Tag]=C6)*(Table1[Date]>=$C$4)*(Table1[Date]<EDATE($C$4,1)))
    Thank you!!! That's exactly what I needed.

+ 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] Formula/method to sort by specific time period within date+time ranges in cell
    By mikeskins84 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 02-13-2018, 01:12 PM
  2. Display previous time period data
    By longsum in forum Excel General
    Replies: 1
    Last Post: 07-28-2015, 03:28 AM
  3. [SOLVED] Copy a specific range to another sheet adding all the workdays for a specific time period
    By MariaPap in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-05-2014, 02:19 AM
  4. Display dates of a specific day in a given period of time
    By krz1407 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 09-06-2013, 09:42 AM
  5. [SOLVED] Counting unique clients during a specific period of time with other criteria
    By dkstew in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 08-30-2012, 12:17 PM
  6. Specific time period calculation from a time range
    By Khaldon in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-18-2011, 06:44 AM
  7. Replies: 2
    Last Post: 04-27-2011, 08:21 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