+ Reply to Thread
Results 1 to 7 of 7

Urgent help needed with formula to count criteris from various worksheets in one workbook

  1. #1
    Forum Contributor
    Join Date
    06-17-2014
    Location
    london
    MS-Off Ver
    365
    Posts
    398

    Urgent help needed with formula to count criteris from various worksheets in one workbook

    Dear All



    I was wondering whether someone can help with the following problem:

    I have a rota workbook. which is divided into monthly tabs. I have attached a simple version of this for your reference.

    I need a formula or VB code (whichever is easier) to do the following:

    In Sept17 sheet I need to look at all the names from previous sheets (Aug17,Jul17,Jun17,May17,Apr17 and Marc17) and at the end of the each row for the names (for name a cells AP14 and AQ14 ) to count the number of times that person has worked on Saturdays (Ap14 = Count of Saturdays worked in previous months and including Saturdays incurrent sheet) and Sundays(AQ14 = Count of Sundays worked in previous months and including Sundays in current sheet). Basically for name A in Sept 17 sheet it counts all the Saturdays which was worked (row 7 has the name of the weeks) from all previous sheets for name A + Saturdays worked in Sep17 and add them and place it on AP14.

    Days worked are if Col B to AC and should only count those which are = AD,IN,E,L,E/B,L/UB.

    I really hope I am clear in what I am trying to achieve. Any urgent help is appreciate it
    Attached Files Attached Files

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Urgent help needed with formula to count criteris from various worksheets in one work

    Hello and welcome to the forum.

    You are making the same mistake that I see time and time again. You are mixing up the two elements of data capture and final reporting. The two require quite different treatments.

    A lot of people start by designing the form that they expect to see as the final report or which at first glance seems the best way of capturing data, and then wonder why it's so difficult to subsequently analyse and summarise or extract information from it. Yours exhibits all those features.

    You should always capture data in a simple two dimensional table and worry about reporting information from it afterwards. Without exception doing this you will always be able to easily obtain management information. Rarely is this the case if you start the other way round.
    You will also throw open the whole wonderful world of the powerful Pivot table functionality and Slicers to filter stuff you need to see.

    So before you get too far with this and lock you into an inflexible system create a single sheet database that contains all the columns needed to capture information about every event, an event being a unique occurrence of date, person, shift, hours, and any other information you need to present, count or sum.

    Some of the input cells could be Validation drop down cells from which you could pick values. The way I normally arrange these things is to have a single data entry row above the database in which the new values are entered, then a button which runs a macro that adds the new record to the database.

    I know that's not a direct answer to your question but believe me you're storing up problems and making it much harder for yourself with your current system.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    31,000

    Re: Urgent help needed with formula to count criteris from various worksheets in one work

    Try

    Saturdays (in each sheet as you already calculate these in some sheets)

    =SUM(COUNTIFS($B$7:$AC$7,"Sat",$B14:$AC14,{"AD","IN","E","L","E/B","L/UB"}))

    and Sundays

    =SUM(COUNTIFS($B$7:$AC$7,"Sun",$B14:$AC14,{"AD","IN","E","L","E/B","L/UB"}))

    If ALL the data is in consistent rows and columns in each sheet (which it is NOT currently) you can use

    =SUM(MAR17:SEP17,AI14) to give Saturdays for "a"

  4. #4
    Forum Contributor
    Join Date
    06-17-2014
    Location
    london
    MS-Off Ver
    365
    Posts
    398

    Re: Urgent help needed with formula to count criteris from various worksheets in one work

    Dear Richard

    Thank you for you help and advice, I completely agree with you , however I was given this spreadsheet and had to do this quickly hence my question. Thanks for the help .

    Dear John, thank you for you solution I have to make the sheets consistent and your solution work, I was hoping for a quick fix but unfortunately your suggestion seems to work.

    Thanks again for all your helps

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    31,000

    Re: Urgent help needed with formula to count criteris from various worksheets in one work

    Interesting response ...

    unfortunately your suggestion seems to work. ....

  6. #6
    Forum Contributor
    Join Date
    06-17-2014
    Location
    london
    MS-Off Ver
    365
    Posts
    398

    Re: Urgent help needed with formula to count criteris from various worksheets in one work

    Sorry I was typing this quickly , I didn't mean anything bad by this, basically you solution does work and thank you , the unfortunate bit is I have to change the rows and columns to make everything consistent:-)

    I am very grateful for all the help I have had in this forum:-)

  7. #7
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    31,000

    Re: Urgent help needed with formula to count criteris from various worksheets in one work

    ... My reply was "tongue in cheek": I did understand that my solution involved you in a little more work but offered a simple solution, given you were already doing the calculations on the monthly sheets

+ 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. Replies: 5
    Last Post: 05-10-2016, 08:00 PM
  2. URGENT HELP NEEDED - Compare worksheets and report differences
    By yramani in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-28-2014, 10:57 AM
  3. IF, AND formula needed - Urgent
    By kiwiram in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-20-2012, 06:23 AM
  4. Urgent help needed on copying sheets from 1 workbook to another
    By fionsnow in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-26-2012, 01:57 AM
  5. Count formula needed...urgent
    By senjuti.sarkar in forum Excel General
    Replies: 14
    Last Post: 03-09-2012, 02:00 AM
  6. Replies: 7
    Last Post: 01-10-2012, 10:47 AM
  7. Urgent help needed: Count Unique visible cells
    By barkiny in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-18-2007, 10:40 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