+ Reply to Thread
Results 1 to 13 of 13

Count/Sum based on another column date range/value

  1. #1
    Registered User
    Join Date
    10-19-2016
    Location
    Dhaka
    MS-Off Ver
    2013
    Posts
    54

    Count/Sum based on another column date range/value

    Dear Experts,

    Good Day, How are you doing all? Hope all are safe & healthy in this pandemic situation.

    I am facing problem to make reports based on raw data. I did some experiment to do it but I failed. Here I have attached the sheet for your understating & and explain inside what required in my reporting. Hope I could get some help from you.

    Thanks in advance.

    Regards,
    Iqbal
    Attached Files Attached Files
    Last edited by iqbal.88; 01-21-2021 at 06:49 AM.

  2. #2
    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,780

    Re: Count/Sum based on another column date range/value

    For counts and sums with criteria in other columns, have a look at COUNTIF(S) and SUMIF(S).

    Let us know if you need any further help once you have tried these for yourself.
    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.

  3. #3
    Registered User
    Join Date
    10-19-2016
    Location
    Dhaka
    MS-Off Ver
    2013
    Posts
    54

    Re: Count/Sum based on another column date range/value

    Thanks for your reply.

    Already I able to solve one part with the help of COUNTIFS & SUMIFS, but rest parts I cant do. Pls have a look in my attached sheet. also I have make some notes in the sheet for your understanding regarding problems & outcome
    Last edited by iqbal.88; 01-24-2021 at 11:38 PM. Reason: Highlight txt part

  4. #4
    Registered User
    Join Date
    10-19-2016
    Location
    Dhaka
    MS-Off Ver
    2013
    Posts
    54

    Re: Count/Sum based on another column date range/value

    Any help or solution pls?

  5. #5
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,557

    Re: Count/Sum based on another column date range/value

    Perhaps the following will be of some help. On the One Year All Marketing sheet:
    1. Paste the following into cell E3 and copy down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    2. Paste the following into cell F3 and copy down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    While attempting to help on the December -2020 I discovered that there are merged cells in both columns D and I on the 2020 sheet which is making it difficult to proceed. Those cells should be unmerged and values placed in each resulting blank cells. Once that is done make a new post to this thread and I will attempt to provide further help.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  6. #6
    Registered User
    Join Date
    10-19-2016
    Location
    Dhaka
    MS-Off Ver
    2013
    Posts
    54

    Re: Count/Sum based on another column date range/value

    Dear @JeteMC Bro,

    Thanks for your reply with some solution. I put your formula in the sheet 'One Year All Marketing' as you guided, the result seems to be OK.

    Update: After applying your formula, there is no result from august to December, but there should be some result for those month. because Those month also have some value in Column J in sheet '2020'. proof attached.
    p1.PNG

    Aug.PNG

    I already updated data sheet '2020' by unmerging the cells & placed a value in blanked cell. Pls help me there.
    Attached Files Attached Files
    Last edited by iqbal.88; 01-26-2021 at 07:47 AM. Reason: Additional Info

  7. #7
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,557

    Re: Count/Sum based on another column date range/value

    For some reason when the range is 5:12000 the formulas on the January 2020 sheet display a value error, however when the range is 5:2140 the formulas yield numbers.
    For column D: =COUNTIFS('2020'!D$5:D$2140,">="&L$1,'2020'!D$5:D$2140,"<="&EOMONTH(L$1,0),'2020'!I$5:I$2140,B3)
    For column E: =SUMIFS('2020'!F$5:F$2140,'2020'!D$5:D$2140,">="&L$1,'2020'!D$5:D$2140,"<="&EOMONTH(L$1,0),'2020'!I$5:I$2140,B3)
    For column F: =COUNTIFS('2020'!D$5:D$2140,">="&L$1,'2020'!D$5:D$2140,"<="&EOMONTH(L$1,0),'2020'!I$5:I$2140,B3,'2020'!J$5:J$2140,"<>")
    For column G: =SUMIFS('2020'!F$5:F$2140,'2020'!D$5:D$2140,">="&L$1,'2020'!D$5:D$2140,"<="&EOMONTH(L$1,0),'2020'!I$5:I$2140,B3,'2020'!J$5:J$2140,"<>")
    Let us know if you have any questions.

  8. #8
    Registered User
    Join Date
    10-19-2016
    Location
    Dhaka
    MS-Off Ver
    2013
    Posts
    54

    Re: Count/Sum based on another column date range/value

    Dear @JeteMC,

    Thanks for your effort. I entered your formulas in sheet "January-2020", initially it shown empty result b'coz of cell L$1 was null. So I putted there a date value of First Day of January 2020. Now it it seems that results comes out OK.

    So, now question is why I couldn't set the row range till 5:12000? Actually I want to set the range to a extended level for future big data range.

    And could you pls check again the 'One Year All Marketing' sheets result in column E:F. in some cells results are missing & also if you match filtered results of the raw sheet (2020) month wise [column D] , some results are not matching. Pls see my previous post wit screenshots.
    Like June month showing total 61 counts in filtered data [Column J], but the formulated result showing 34 counts.
    Attached Files Attached Files

  9. #9
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,557

    Re: Count/Sum based on another column date range/value

    My suggestion would be to convert the range with data on the 2020 sheet into a table. As the data covers rows 5:2140 the formulas on the other two sheets should reference those rows. When the table is expanded, by selecting cell L2140 and pressing the tab key, the formulas should automatically adjust to include the added rows.
    I believe that doing so has corrected the other issues.
    Let us know if you have any questions.

  10. #10
    Registered User
    Join Date
    10-19-2016
    Location
    Dhaka
    MS-Off Ver
    2013
    Posts
    54

    Re: Count/Sum based on another column date range/value

    Dear @JateMC Bro,

    Thanks for your suggestion & the help you giving me till now. Yes I believe converting data sheet to Table range would be good solution for the issue.

    But for some reason I need to keep/do some merged cell within column [grouped data] in Data sheet except the reference columns which are used in another sheets [formulas] for making reports. Like, column A in sheet '2020'.

    So, in that case how could I merge those, as merge not working in Table formats?
    Last edited by iqbal.88; 01-30-2021 at 02:36 AM.

  11. #11
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,557

    Re: Count/Sum based on another column date range/value

    If I understand correctly that you can not convert the range A4:L2140 on the 2020 sheet into a table then you might try the following:
    1. Select A2141:L2141
    2. Press the Ctrl, Shift and down arrow keys
    3. Select Clear All from the Editing screen on the Home tab
    You should now be able to rewrite the formulas to reference rows 5:12000 as you were doing originally.
    Let us know if you have any questions.

  12. #12
    Registered User
    Join Date
    10-19-2016
    Location
    Dhaka
    MS-Off Ver
    2013
    Posts
    54

    Re: Count/Sum based on another column date range/value

    Thanks bro for all of your supports!

    Finally I almost able to complete it with your Help.

    One last think, could you advise me if I want make a dynamic sheet/ range ref in the formula, how to do it?

    =COUNTIFS('2020'!D$5:D$2140,">="&L$1,'2020'!D$5:D$2140,"<="&EOMONTH(L$1,0),'2020'!I$5:I$2140,B3)

    Suppose, in this formula I want to refer Sheet name from cell M1, Lower row range from cell M2, & Higher row range from cell M3. Then how should I edit the formula?

    And again take my heartiest thanks for the support. also added REP in the post.

  13. #13
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,557

    Re: Count/Sum based on another column date range/value

    Try:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Let us know if you have any questions.

+ 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. Count occurrences of string in range, based on date range and other criteria
    By neilo1969 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-09-2019, 02:29 AM
  2. [SOLVED] Count duplicate occurrences based on another column within date range
    By chipper49 in forum Excel General
    Replies: 10
    Last Post: 06-10-2019, 04:05 PM
  3. Replies: 3
    Last Post: 12-16-2015, 05:56 PM
  4. Replies: 1
    Last Post: 02-05-2013, 09:14 AM
  5. Formula to Check Column A for date range and count Column B
    By realniceguy5000 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-28-2009, 12:58 PM
  6. Replies: 25
    Last Post: 09-07-2005, 12:05 AM
  7. Replies: 1
    Last Post: 05-05-2005, 04:06 PM

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