+ Reply to Thread
Results 1 to 5 of 5

Getting unique count between two dates with multiple conditions

  1. #1
    Forum Contributor
    Join Date
    08-19-2016
    Location
    Chennai, India
    MS-Off Ver
    2007
    Posts
    300

    Getting unique count between two dates with multiple conditions

    Dear forum experts,

    Need your help to get VBA code for getting unique count between two dates with multiple conditions. Please find the attached model excel sheet for your kind notice.

    Requirement as follows: Steps wise calculation method has been given below:

    Section-1
    1. Firstly, we will enter / select the start and end date from column L1 and L2.
    2. Secondly, Column E date to be filtered based on the date input in L1 and L2.
    3. Thirdly, Column F date to be filtered until L2 date. (no need of from date here)
    4. Highlight "D" column with yellow color and release all the filter.

    Section-2 - In continuation of that, 5th steps in reverse order:
    5. Column F date to be filtered based on the date input in L1 and L2
    6. Column E date to be filtered before the from date only (before 01-04-20)
    7. Highlight "D" column with yellow color and release all the filter.
    8. Now, select column "D" and check highlighted row (Sec 1 & Sec 2) and get unique number based on Column D value. (Patient ID)
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    01-16-2012
    Location
    England
    MS-Off Ver
    MS 365
    Posts
    1,397

    Re: Getting unique count between two dates with multiple conditions

    Attached does what you want and puts the patient ID into L42

    Please Login or Register  to view this content.

    Ochimus
    Attached Files Attached Files
    Last edited by Ochimus; 01-11-2021 at 08:59 PM.

  3. #3
    Forum Contributor
    Join Date
    08-19-2016
    Location
    Chennai, India
    MS-Off Ver
    2007
    Posts
    300

    Re: Getting unique count between two dates with multiple conditions

    Dear Ochimus,

    Sincere thanks for your time and guidance. I have read the code, till 8th step it is coming with flow and address the requirement hope so. But,

    - 9th step to be highlight the Column D cells with yellow color.
    - 10th step to be clear the filters
    - 11th step to be again apply the filter and select only yellow highlighted row
    - 12th step to be getting unique count by state wise as given in the given. (need an output table as given in the I1:J9).

    Moreover, the data table may have huge data, hence I do not want to fix the ranges in the code.

    Clarification required for:

    1. why you have particularly selected "D9" in 10th step in the code.

    Sorry to ask so many questions. Please do the needful.

    Regards


    Quote Originally Posted by Ochimus View Post
    Attached does what you want and puts the patient ID into L42

    Please Login or Register  to view this content.

    Ochimus

  4. #4
    Valued Forum Contributor
    Join Date
    01-16-2012
    Location
    England
    MS-Off Ver
    MS 365
    Posts
    1,397

    Re: Getting unique count between two dates with multiple conditions

    bala,

    Having created the first two steps for you. you will learn more if you try things yourself first.

    Select "View", then "Create Macro" and do manually what you want the sheet to do.

    When you have finished select "End Macro", and you will have the Code that does what you want.

    You can then use the Notes I provided in my post to work out how the Code works.

    And quick note - the Administrators ask people NOT to repost entire previous Posts. If there is a specific point in it you need to highlight, just clip and post that bit.

    Ochimus

  5. #5
    Forum Contributor
    Join Date
    08-19-2016
    Location
    Chennai, India
    MS-Off Ver
    2007
    Posts
    300

    Re: Getting unique count between two dates with multiple conditions

    Dear Mr. Ochimus,

    Thanks a lot for your guidance and support. I will do as suggested. Still i am in learning stage, so that i am asking step by step process. Sorry for that. I will try at my end as you suggested.

    Regards

+ 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] Count unique cells with multiple conditions
    By Sladamuss in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-13-2016, 07:59 AM
  2. [SOLVED] Count unique cells based on multiple conditions
    By Sladamuss in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-10-2016, 05:52 AM
  3. Count Unique Item #'s with multiple conditions
    By Junebug81 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-25-2016, 06:29 PM
  4. Count unique values with multiple conditions
    By liybpg in forum Excel General
    Replies: 6
    Last Post: 03-18-2015, 05:43 AM
  5. Count unique logs with multiple conditions of multiple sheets
    By Robert Bob in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 10-12-2007, 12:49 AM
  6. Advanced unique cell count with multiple conditions ... help!
    By Flystar in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-24-2005, 10:50 PM
  7. Count Unique text based on multiple conditions
    By MAX258 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-13-2005, 01:44 PM

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