+ Reply to Thread
Results 1 to 11 of 11

Counting Blocks of data in a row / record

  1. #1
    Registered User
    Join Date
    09-10-2009
    Location
    Brighton,England
    MS-Off Ver
    Excel 2003
    Posts
    44

    Counting Blocks of data in a row / record

    Hi does anyone know if it is possible to count blocks of data in a row / record?

    I have an absence spreadsheet which shows absence codes for employees when they have time off work. I am trying to find a formula which will count these blocks of codes and give me the total number of absences per month.(not total number of days)

    Please see attached spreadsheet.

    Any help appreciated.
    Attached Files Attached Files
    Last edited by msommerf; 10-06-2010 at 11:07 AM.

  2. #2
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Counting Blocks of data in a row / record

    If you add this UDF to your workbook...

    Please Login or Register  to view this content.

    The you can put the formula:

    Please Login or Register  to view this content.

    In cell AH12 and it will count the absences.

  3. #3
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Counting Blocks of data in a row / record

    Try this

    In AG12
    =COUNTA($B12:$AF12)

    In AH12
    =COUNTIF($B12:$AF12,"L")

    Hope this helps
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  4. #4
    Registered User
    Join Date
    09-10-2009
    Location
    Brighton,England
    MS-Off Ver
    Excel 2003
    Posts
    44

    Re: Counting Blocks of data in a row / record

    Thanks for the response Andrew-R.

    I am unsure as to how I add a UDF to my worksheet.
    Could you please explain?

    Many thanks

  5. #5
    Registered User
    Join Date
    09-10-2009
    Location
    Brighton,England
    MS-Off Ver
    Excel 2003
    Posts
    44

    Re: Counting Blocks of data in a row / record

    Marcol,

    This only counts the absences with the letter "L" In need to count all of the blocks of data.

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Counting Blocks of data in a row / record

    Perhaps:

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    09-10-2009
    Location
    Brighton,England
    MS-Off Ver
    Excel 2003
    Posts
    44

    Re: Counting Blocks of data in a row / record

    SUMPRODUCT does the Trick.

    Thank You so much DONKEYOTE

  8. #8
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Counting Blocks of data in a row / record

    I *really* must learn how SUMPRODUCT works.

  9. #9
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Counting Blocks of data in a row / record

    The link in my sig. is IMO the best tutorial I've come across - c/o Bob Phillips (member here, MS Excel MVP etc...)

    I wrote an add-in a while back to generate the type of calculation tables Bob's page uses for error trapping / educational purposes.
    With copious help from romperstomper & Richard Schollar the "seemingly" complete version is available at my box.net site: http://www.box.net/shared/tfpqhbeoes

    Bob was doing some work at some stage I think trying to pull the original source values into the calc tables but that's a non-trivial task given complexity and variation of formulae - I've not heard anything on it since.
    (this was put together a good while back)

  10. #10
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Counting Blocks of data in a row / record

    And I *really* must learn how to waken up!.

  11. #11
    Registered User
    Join Date
    09-10-2009
    Location
    Brighton,England
    MS-Off Ver
    Excel 2003
    Posts
    44

    Re: Counting Blocks of data in a row / record

    Awake or Asleep, its good to have the help of all you guys.

    Many thanks for solving my problem so quickly.

    It is much appreciated

    Thank you all

    Mark.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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