Results 1 to 15 of 15

COUNTIFS Does not Return Results for UK based users

Threaded View

  1. #1
    Registered User
    Join Date
    09-27-2017
    Location
    Kitchener, Ontario
    MS-Off Ver
    2016
    Posts
    5

    COUNTIFS Does not Return Results for UK based users

    Hello - I'm sure this has been covered somewhere but I've been searching for days with no success. Sharing the spreadsheet will require a lot of work to allow me to release it so hopefully I've been clear enough with my notes below.

    First the problem - I have a Macro that performs a COUNTIFS for a number of things including a Greater Than Or Equal To date and a Less Than OR Equal To date. I am based in North America and this works perfectly for any other users in North America. UK based users return no matches unless I comment out the Date filters in the COUNTIFS.

    Background:
    - My Excel file needs to import source data (from .xlsx) that does not have a consistent file naming convention so I have a "file picker" that allows the user to select the proper source file and then the VBA script will copy the data and paste it to a Worksheet (InputSheet). Clearing out data with minimal user interaction between each use of the spreadsheet is critical so I have not looked at a "Data -> Get Data" import.
    - The dates in the source file are in format yyyy-mm-dd hh:mm so I have a formula column in the InputSheet where I use "=INT(B2)" to get it into a date format
    - Created a second formula column, for UK date format, in InputSheet where I use "=INT(B2) to get it into a date format
    - Users in US set the date range for the report by typing in a start date and end date (in UserInputSheet) in format mm/dd/yyyy
    - Users in UK set the date range for the report by typing in a start date and end date (in UserInputSheet) in format dd/mm/yyyy
    - Table Data and a Chart are presented in OutputSheet


    Sample of the CountIfs for US (part of a For Loop):
    OutputSheet.Cells(6, column).Value = Application.WorksheetFunction.CountIfs( _
    InputSheet.Range(InputSheet.Cells(2, 3), InputSheet.Cells(Rows, 3)), Worksheets("OutputSheet").Cells(3, Column), _
    InputSheet.Range(InputSheet.Cells(2, 5), InputSheet.Cells(Rows, 5)), Worksheets("OutputSheet").Cells(6, 1), _
    InputSheet.Range(InputSheet.Cells(2, 10), InputSheet.Cells(Rows, 10)), ">=" & UserInputSheet.Range("B1"), _
    InputSheet.Range(InputSheet.Cells(2, 10), InputSheet.Cells(Rows, 10)), "<=" & UserInputSheet.Range("B2"))

    Sample of the CountIfs for US (part of a For Loop):
    OutputSheet.Cells(6, column).Value = Application.WorksheetFunction.CountIfs( _
    InputSheet.Range(InputSheet.Cells(2, 3), InputSheet.Cells(Rows, 3)), Worksheets("OutputSheet").Cells(3, Column), _
    InputSheet.Range(InputSheet.Cells(2, 5), InputSheet.Cells(Rows, 5)), Worksheets("OutputSheet").Cells(6, 1), _
    InputSheet.Range(InputSheet.Cells(2, 11), InputSheet.Cells(Rows, 11)), ">=" & UserInputSheet.Range("E1"), _
    InputSheet.Range(InputSheet.Cells(2, 11), InputSheet.Cells(Rows, 11)), "<=" & UserInputSheet.Range("E2"))

    Each of the above are their own Sub to avoid any issues. They are identical other than the column I'm looking at for the date of the source data and the cells I'm looking at for the date range.

    Dates in UserInputSheet are Date format 2012-03-14 "English United States"
    Dates in US Calculated column in InputSheetare Date format mm/dd/yyyy "English United States"
    Dates in UK Calculated column in InputSheetare Date format dd/mm/yyyy "English United Kingdom"

    If I set my PC to English United Kingdom in the Control Panel Region it makes no differerence. The US script still works and the UK script still fails.

    My guess right now is that the INT formula isn't ideal.

    Any help would be greatly appreciated!
    Attached Files Attached Files
    Last edited by SDillon; 03-14-2020 at 11:09 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Lookup 2 values and return results based on these
    By Philly500 in forum Excel General
    Replies: 4
    Last Post: 08-26-2015, 07:02 AM
  2. Display results based on certain categories of users
    By tnovak in forum Excel General
    Replies: 2
    Last Post: 10-14-2014, 12:51 PM
  3. [SOLVED] Countifs based on two condition and display results only one time
    By kkharis in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 11-16-2013, 05:56 AM
  4. Countifs should return blank results for blank row of cells
    By Groovicles in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-29-2013, 06:20 PM
  5. Return Results Based on Date Range
    By ExcelSuduko in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-05-2013, 11:23 AM
  6. Replies: 0
    Last Post: 12-16-2011, 09:01 AM
  7. Return results based on multiple criteria
    By Bryce in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-28-2005, 08:05 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