+ Reply to Thread
Results 1 to 8 of 8

Counting accummilation of hours??

  1. #1
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161

    Counting accummilation of hours??

    Hi all,

    I have a workbook that currently has a count up sheet for an instance of certain text in a named range, it counts when people have been booked off work, my problem is that rather than booking days off in the future they will be booking either an 8 hour day in one period or a 12 our day in another and have a total 0f 128 hours to book off. I want to be able to count the amount of hours on my count up sheet for text found in the source sheet, so if "Bloggs J" appears in named range "Hols" and is in between cells A1:A20 then its 8 added to the count up but if it appears in named range "Hols" between cells A20:A30 it adds 12 to the count up!?

    I can mail you my current workbook so you can see how it all works at the moment.

    Any thoughts?

    Simon

    P.S i currently use =COUNTIF(Hols,"Bloggs J")
    Last edited by Simon Lloyd; 07-28-2005 at 02:03 AM. Reason: missing info

  2. #2
    Aaron Howe
    Guest

    RE: Counting accummilation of hours??

    A quick way of doing it would be:

    =IF(COUNTIF(Hols1,"Bloggs J"),COUNTIF(Hols1,"Bloggs
    J")+8,IF(COUNTIF(Hols2,"Bloggs J"),COUNTIF(Hols1,"Bloggs J")+12,0))

    Thereby using a nested IF statement. However, bear in mind that ADDS 8 to
    the count, so where J Bloggs appears in Hols1 (Cells 1 to 20), you will have
    that one count *and* an additional 8 - therefore a count of 9 overall. Also,
    to do this you would have to split the two ranges into different names. This
    was just a quick resolution, I'm sure one of the guys here will have a far
    more graceful way of achieving what you are looking for.

    HTH

    "Simon Lloyd" wrote:

    >
    > Hi all,
    >
    > I have a workbook that currently has a count up sheet for an instance
    > of certain text in a named range, it counts when people have been
    > booked off work, my problem is that rather than booking days off in the
    > future they will be booking either an 8 hour day in one period or a 12
    > our day in another and have a total 0f 128 hours to book off. I want to
    > be able to count the amount of hours on my count up sheet for text found
    > in the source sheet, so if "Bloggs J" appears in named range "Hols" and
    > is in between cells A1:A20 then its 8 added to the count up but if it
    > appears in named range "Hols" between cells A20:A30 it adds 12 to the
    > count up!?
    >
    > I can mail you my current workbook so you can see how it all works at
    > the moment.
    >
    > Any thoughts?
    >
    > Simon
    >
    > P.S i currently use =COUNTIF(Hols,"Bloggs J")
    >
    >
    > --
    > Simon Lloyd
    > ------------------------------------------------------------------------
    > Simon Lloyd's Profile: http://www.excelforum.com/member.php...fo&userid=6708
    > View this thread: http://www.excelforum.com/showthread...hreadid=390844
    >
    >


  3. #3
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161
    Hi Aaron,

    Thanks for the speedy reply,

    I tried your solution but it gave me this error in the cell #NAME? i tried modifying it to no avail........am i missing something?

    Simon

    P.S sorted the #NAME? problem

    P.P.S After the initial count of 9 it only increses by one each time regardles if its a 12hr period or 8hr
    Last edited by Simon Lloyd; 07-28-2005 at 06:32 AM.

  4. #4
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161
    Sorted the only counting by one, but can not get it to also add on the 12hr periods in the second named range!

    Can anyone sort this muddle out please?

    Simon

    =IF(COUNTIF(Hols1,"Bloggs J"),COUNTIF(Hols1,"Bloggs J")*8,AND(COUNTIF(Hols2,"Bloggs J"),COUNTIF(Hols2,"Bloggs J")*12,0))

  5. #5
    Aaron Howe
    Guest

    Re: Counting accummilation of hours??

    Make sure you named your ranges in line with the formula; or if you're using
    different names change the formula accordingly Also, make sure the line
    breaks this website adds to the text are removed as that sometimes trips me
    up...

    "Simon Lloyd" wrote:

    >
    > Hi Aaron,
    >
    > Thanks for the speedy reply,
    >
    > I tried your solution but it gave me this error in the cell #NAME? i
    > tried modifying it to no avail........am i missing something?
    >
    > Simon
    >
    >
    > --
    > Simon Lloyd
    > ------------------------------------------------------------------------
    > Simon Lloyd's Profile: http://www.excelforum.com/member.php...fo&userid=6708
    > View this thread: http://www.excelforum.com/showthread...hreadid=390844
    >
    >


  6. #6
    Toppers
    Guest

    Re: Counting accummilation of hours??

    Simon,
    Try this:

    =COUNTIF(Hols1,"Bloggs J")*8+COUNTIF(Hols2,"Bloggs J")*12

    HTH

    "Simon Lloyd" wrote:

    >
    > Sorted the only counting by one, but can not get it to also add on the
    > 12hr periods in the second named range!
    >
    > Can anyone sort this muddle out please?
    >
    > Simon
    >
    > =IF(COUNTIF(Hols1,"Bloggs J"),COUNTIF(Hols1,"Bloggs
    > J")*8,AND(COUNTIF(Hols2,"Bloggs J"),COUNTIF(Hols2,"Bloggs J")*12,0))
    >
    >
    > --
    > Simon Lloyd
    > ------------------------------------------------------------------------
    > Simon Lloyd's Profile: http://www.excelforum.com/member.php...fo&userid=6708
    > View this thread: http://www.excelforum.com/showthread...hreadid=390844
    >
    >


  7. #7
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161

    Thumbs up

    Cheers Toppers that worked a treat!


    Simon!

  8. #8
    Aaron Howe
    Guest

    Re: Counting accummilation of hours??

    Ahh sorry didn't realise both 8hrs and 12hrs were an option, that obviously
    makes it easier! Thought it was one or the other

    "Toppers" wrote:

    > Simon,
    > Try this:
    >
    > =COUNTIF(Hols1,"Bloggs J")*8+COUNTIF(Hols2,"Bloggs J")*12
    >
    > HTH
    >
    > "Simon Lloyd" wrote:
    >
    > >
    > > Sorted the only counting by one, but can not get it to also add on the
    > > 12hr periods in the second named range!
    > >
    > > Can anyone sort this muddle out please?
    > >
    > > Simon
    > >
    > > =IF(COUNTIF(Hols1,"Bloggs J"),COUNTIF(Hols1,"Bloggs
    > > J")*8,AND(COUNTIF(Hols2,"Bloggs J"),COUNTIF(Hols2,"Bloggs J")*12,0))
    > >
    > >
    > > --
    > > Simon Lloyd
    > > ------------------------------------------------------------------------
    > > Simon Lloyd's Profile: http://www.excelforum.com/member.php...fo&userid=6708
    > > View this thread: http://www.excelforum.com/showthread...hreadid=390844
    > >
    > >


+ 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