+ Reply to Thread
Results 1 to 6 of 6

Need assistanct with sum formula based on a date as well a special text condition

  1. #1
    Valued Forum Contributor
    Join Date
    03-17-2007
    Location
    Michigan
    MS-Off Ver
    Excel 2016
    Posts
    957

    Need assistanct with sum formula based on a date as well a special text condition

    Hello, I need assistance if possible to have a formula look for any cells in D1 to GG1 that have "H" in it and if they fall pre-anniversary to a specified date then it would sum the individual cell (starting in row 3 and below as determined by the "H" in row 1) hours and sum them up. I've attached a sample workbook with probably a better explanation.

    As holiday dates can change from year to year I need the formula to be flexible in that it will rely on the "H" placement ; i.e. the formula once completed would allow another "H" to be put in any spot in row 1 and any hours would be calculated either pre or post anniversary with any other data collected with a "H" designator. Hope this makes sense.

    This formula helped determine my pre-anniversary hours:
    Please Login or Register  to view this content.
    and this formula will locate my "H" and sum the necessary info but it doesn't differentiate the anniversary dates Pre and/or Post:
    Please Login or Register  to view this content.
    I need a formula that will combine them. Any assistance would be greatly appreciated..if this is even possible. Thanks in advance!
    Attached Files Attached Files
    Last edited by lilsnoop; 12-02-2012 at 11:32 PM.

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

    Re: Need assistanct with sum formula based on a date as well a special text condition

    you are using 2007, that includes a new function called sumifS(). it allows for a far greater range of criteria, give it a try and see if that will give you what you need?
    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

  3. #3
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: Need assistanct with sum formula based on a date as well a special text condition

    Try this for PRE-anniversary [GO3]:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    and this for POST-anniversary [GP3]:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    - Moo

  4. #4
    Valued Forum Contributor
    Join Date
    03-17-2007
    Location
    Michigan
    MS-Off Ver
    Excel 2016
    Posts
    957

    Re: Need assistanct with sum formula based on a date as well a special text condition

    Thanks Moo and FDibbins!! I appreciate your advice and help! I had researched the sumifs function and this formula worked for the pre:
    Please Login or Register  to view this content.
    and this formula for the post
    Please Login or Register  to view this content.
    Moo I'll play with your formula too just to make sure mine doen't run into any issues. Thanks again!!

  5. #5
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: Need assistanct with sum formula based on a date as well a special text condition

    You're welcome, glad to help.
    - Moo

    * And nice solution with the SUMIFS too.

  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,946

    Re: Need assistanct with sum formula based on a date as well a special text condition

    happy to help

+ 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