+ Reply to Thread
Results 1 to 8 of 8

counting aid

  1. #1
    Registered User
    Join Date
    09-09-2012
    Location
    Dudley
    MS-Off Ver
    Excel 2003
    Posts
    33

    counting aid

    Hello. I need to be able to count the last 12 full weeks worked. This may not be the last 12 weeks, as I may of had a day off sick in the last twelve. I need to work out my last 12 weeks average pay for holiday accrual. I'm not really making sense here I guess, but I know what I'm trying to do, I just can't do it. Basically I need excel to find the last 12 times I worked over 37.99 hours, add them up to give me a total, and then stop. Any advice please? I can't upload my worksheet, as it's too big. I'm a complete newbie, and proud of my efforts so far, so please be kind and patient. Thanks in advance. Mark

  2. #2
    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
    28,245

    Re: counting aid

    Please post a sample of your data showing expected results.

  3. #3
    Registered User
    Join Date
    09-09-2012
    Location
    Dudley
    MS-Off Ver
    Excel 2003
    Posts
    33

    Re: counting aid

    Thanks John for your reply. I have uploaded a copy of some of my spreadsheet.
    On page one are my wages from September,
    including days off or holiday.
    On page two, are the last 12 FULL weeks I have worked.
    This sheet was done by copying all the rows with a RED CELL in them,
    that shows I worked 38 hours, and then PASTED onto sheet two.
    This is what I want excel to do for me automatically. Find the last 12 FULL weeks(38 hours plus),
    and add up the total earnings from them.
    Any advice you can give would be helpful. I have been looking up the COUNTIF/COUNTIFS, but think these will just
    count the totals altogether, and not filter out the 12 full weeks, and stop at the last 12.
    Hope I'm making sense here.
    Thanks again
    Mark

  4. #4
    Registered User
    Join Date
    09-09-2012
    Location
    Dudley
    MS-Off Ver
    Excel 2003
    Posts
    33

    Re: counting aid

    Try again, files attached

  5. #5
    Registered User
    Join Date
    09-09-2012
    Location
    Dudley
    MS-Off Ver
    Excel 2003
    Posts
    33

    Re: counting aid

    Third time lucky.... attached worksheet
    Attached Files Attached Files

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,944

    Re: counting aid

    You have 2 week 46's in your table...rows 33 and 51 (looks like row 33 should be 28?)

    If so, then put this ARRAY formula in A6 and copy down...
    =IF(ROWS($A$6:A6)>12,"",LARGE(IF('This is my Earnings'!$D$6:$D$57>=38,'This is my Earnings'!$A$6:$A$57),ROW(A1)))
    (if you want to have the "12" easily adjustable, put that in it's own cell, and reference it instead)
    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.

    Then for the other data...
    1. make sure your headings on each sheet match - in the FIRST row only.
    2. Copy thos to B6, then copy down and across as needed...
    =IF(A23="","",INDEX('This is my Earnings'!$A:$N,MATCH('This is the last 12 FULL WEEKS'!$A23,'This is my Earnings'!$A:$A,0),MATCH('This is the last 12 FULL WEEKS'!B$1,'This is my Earnings'!$A$1:$N$1,0)))
    You need to copy the formatting across, so they look how you want them to
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  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
    28,245

    Re: counting aid

    See attached. Formulae in A to C of the copy worksheet.

    I adjusted Ford's formula (column B) to get the dates in order required. The formula in A & C can be used to retrieve other data from your "Earning" sheet: just modify the range in the INDEX but leave MATCH as it is.


    Also changed your summation/averages to be formulae.

    Note : change Match to $Bn rather than Bn


    =INDEX('This is my Earnings'!$C$6:$C$57,MATCH($B6,'This is my Earnings'!$B$6:$B$57,0))

    Hope this helps
    Attached Files Attached Files

  8. #8
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: counting aid

    See the attached file
    i do it for 2 columns for you rest do your own
    Attached Files Attached Files
    Last edited by samba_ravi; 06-28-2015 at 05:29 AM.
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

+ 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] Counting Matching values in two separate ranges without counting duplicates
    By Rhall6310 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-01-2014, 03:35 PM
  2. Replies: 3
    Last Post: 03-01-2012, 06:17 AM
  3. Replies: 6
    Last Post: 02-04-2012, 06:57 PM
  4. counting cells with data without counting duplicates
    By labettis in forum Excel General
    Replies: 2
    Last Post: 11-05-2007, 12:10 PM
  5. [SOLVED] Counting rows, then counting values.
    By Michael via OfficeKB.com in forum Excel General
    Replies: 7
    Last Post: 08-04-2005, 06:05 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