+ Reply to Thread
Results 1 to 11 of 11

Counting items based on criteria located in multiple columns

  1. #1
    Registered User
    Join Date
    08-01-2021
    Location
    Singapore
    MS-Off Ver
    365
    Posts
    5

    Counting items based on criteria located in multiple columns

    Hi

    I'm working on a dataset which contains 'Date' and 'Type' of audits.

    I need to count across the range, for number of instances where:
    1. The 'Date is between 1st Jan 2018 and 1st April 2018' and
    2. Type is 'S'.

    There may be situations where I need to insert column between D&Q. SO, the formula should automatically adjust for the column insertion.

    1.png
    Attached Files Attached Files
    Last edited by nabok; 08-04-2021 at 04:46 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,237

    Re: COUNTIFS Complication

    Welcome to the forum.

    There are instructions at the top of the page explaining how to attach your sample workbook.
    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
    07-15-2021
    Location
    England
    MS-Off Ver
    365
    Posts
    6

    Re: Counting items based on criteria located in multiple columns

    Hi Nabok,

    Did you ever get this sorted?

    Andrew

  4. #4
    Registered User
    Join Date
    08-01-2021
    Location
    Singapore
    MS-Off Ver
    365
    Posts
    5

    Re: Counting items based on criteria located in multiple columns

    Hey Andrew

    Not yet.

    The only solution that I can think of is COUNTIFS but the problem is that it will not work across full range of cell. COUNTIF works with specified columns and not with range

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

    Re: Counting items based on criteria located in multiple columns

    I can solve it for you - but I’m waiting for the workbook to be attached.

  6. #6
    Registered User
    Join Date
    08-01-2021
    Location
    Singapore
    MS-Off Ver
    365
    Posts
    5

    Re: COUNTIFS Complication

    I have attached AliGW

  7. #7
    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,237

    Re: Counting items based on criteria located in multiple columns

    Where should the count appear? Where have you mocked up your expected results for the sample dataset?

  8. #8
    Registered User
    Join Date
    08-01-2021
    Location
    Singapore
    MS-Off Ver
    365
    Posts
    5

    Re: Counting items based on criteria located in multiple columns

    The results should appear in Sheet 'Datamining'; Row G

  9. #9
    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,237

    Re: Counting items based on criteria located in multiple columns

    Yuo seem to be almost there. Try this:

    =COUNTIFS('Database and Planner'!E4:AG6,"S",'Database and Planner'!D4:AF6,">="&Datamining!B4,'Database and Planner'!D4:AF6,"<="&Datamining!C4)

  10. #10
    Registered User
    Join Date
    08-01-2021
    Location
    Singapore
    MS-Off Ver
    365
    Posts
    5

    Re: Counting items based on criteria located in multiple columns

    Awesome AliGW!! It works well.
    Wonder where was i going wrong!!

  11. #11
    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,237

    Re: Counting items based on criteria located in multiple columns

    You did two things wrong:

    1. Your ranges were not long (wide) enough.
    2. You were referencing the dates with the VALUE() function - that's not needed.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ 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. Text-to-column with a complication
    By enjoylois in forum Excel General
    Replies: 3
    Last Post: 07-07-2021, 06:10 PM
  2. IFStatment complication
    By ct00010 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-21-2021, 12:26 PM
  3. Removing Duplicates Complication
    By MikeSham in forum Excel General
    Replies: 5
    Last Post: 07-04-2016, 11:42 PM
  4. [SOLVED] Copying from one sheet to another with complication
    By tony7262 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 04-26-2016, 11:19 AM
  5. [SOLVED] Referencing a cell complication
    By trainerwatts3 in forum Excel General
    Replies: 4
    Last Post: 10-31-2014, 09:59 AM
  6. [SOLVED] Conditional Formatting Complication
    By Graphic Allen in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-03-2014, 10:41 AM
  7. [SOLVED] Swap text in a cell complication
    By alexxshadows in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 11-14-2012, 09:06 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