+ Reply to Thread
Results 1 to 8 of 8

Sum worker hours by last name only

  1. #1
    Registered User
    Join Date
    12-07-2021
    Location
    Canada
    MS-Off Ver
    OFFICE 2016
    Posts
    2

    Sum worker hours by last name only

    hey guys,

    I have 2 columns: full name and working hours. I need to check how many workers have only 2 letters in the last name and then for the sum of how many hours they worked. I tried to do this using an array formula but was unsuccessful.

    tnx for the help

  2. #2
    Valued Forum Contributor
    Join Date
    07-24-2021
    Location
    Japan
    MS-Off Ver
    Google Sheets (& Mac 2021)
    Posts
    913

    Re: Sum worker hours by last name only

    are you able to upload a file with sample data so that we can see what you are referring to?

  3. #3
    Registered User
    Join Date
    12-07-2021
    Location
    Canada
    MS-Off Ver
    OFFICE 2016
    Posts
    2

    Re: Sum worker hours by last name only

    1.jpg

    I added a picture with the table...
    i need the function to calculate how manny workers has only 2 letters in their last name.
    in the file you can see i have only 2 workers: John Ma and Rachel Nu.

    i need to sum their work hours so i need first to check only the workers with 2 letters in the last name and sum their hours

  4. #4
    Valued Forum Contributor
    Join Date
    07-24-2021
    Location
    Japan
    MS-Off Ver
    Google Sheets (& Mac 2021)
    Posts
    913

    Re: Sum worker hours by last name only

    a sample file will be greatly appreciated so that those who are helping do not need to create a sample file for you with which to develop and prove a workable solution.

  5. #5
    Administrator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs
    MS-Off Ver
    MS Office 365 Version 2211 (Build 15813.20002) Win 11 Home 64 Bit
    Posts
    22,117

    Re: Sum worker hours by last name only

    Hi and welcome to the forum

    Pictures are of little value. Honestly, no one wants to re-type your data to try and solve your issue. Additionally, we would only be guessing at how your data was structured, ie. formulas, formatting, etc. Additionally, due to how some browsers behave, many of our members cannot see uploaded pictures/images. Please do not take this route.

    Please attach a sample file that represents what you have. The structure of your attachment should be the same structure as your actual data. Any proprietary information should be changed.

    Include in the attachment any code you're currently using (whether it works or not) and an "After" of what you wish the output to be.

    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    Alan


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  6. #6
    Forum Contributor
    Join Date
    03-05-2018
    Location
    Tbilisi, Georgia
    MS-Off Ver
    2013, 2016
    Posts
    264

    Re: Sum worker hours by last name only

    I don't know why, but tonight I am in the mood to re-type your data)), So try this:
    Hours: =SUMPRODUCT(N(LEN(TRIM(RIGHTB(SUBSTITUTE($A$2:$A$40;" ";REPT(" ";99));50)))=2);$B$2:$B$40)
    Workers: =SUMPRODUCT(N(LEN(TRIM(RIGHTB(SUBSTITUTE($A$2:$A$40;" ";REPT(" ";99));50)))=2))
    Attached Files Attached Files
    Last edited by T.I.; 12-07-2021 at 07:47 PM.

  7. #7
    Administrator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs
    MS-Off Ver
    MS Office 365 Version 2211 (Build 15813.20002) Win 11 Home 64 Bit
    Posts
    22,117

    Re: Sum worker hours by last name only

    Since Strogg was willing to do the heavy lifting, I have proposed an alternative solution using Power Query.

    Please Login or Register  to view this content.
    Power Query is a free AddIn for Excel 2010 and 2013, and is built-in functionality from Excel 2016 onwards (where it is referred to as "Get & Transform Data").

    It is a powerful yet simple way of getting, changing and using data from a broad variety of sources, creating steps which may be easily repeated and refreshed. I strongly recommend learning how to use Power Query - it's among the most powerful functionalities of Excel.

    - Follow this link to learn how to install Power Query in Excel 2010 / 2013.

    - Follow this link for an introduction to Power Query functionality.

    - Follow this link for a video which demonstrates how to use Power Query code provided.
    Attached Files Attached Files

  8. #8
    Administrator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs
    MS-Off Ver
    MS Office 365 Version 2211 (Build 15813.20002) Win 11 Home 64 Bit
    Posts
    22,117

    Re: Sum worker hours by last name only

    Here is an updated spreadsheet using the same concept only offering a dynamic parameter that lets you select the number of letters in the last name. Instruction on how to use are in the spreadsheet.
    Attached Files Attached Files

+ 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] Next Worker from List
    By rwaugh in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-22-2021, 01:59 PM
  2. Replies: 4
    Last Post: 04-21-2020, 09:13 AM
  3. Calculate total hours worked in week by worker name
    By evgemans in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 06-23-2019, 12:24 PM
  4. Replies: 3
    Last Post: 06-16-2019, 05:49 AM
  5. Total Hours worked per Job or Worker
    By DJohnson2 in forum Excel General
    Replies: 2
    Last Post: 07-19-2012, 11:10 AM
  6. Print Worker if between
    By Squall13 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-23-2011, 04:34 PM
  7. Replies: 5
    Last Post: 08-02-2010, 07:25 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