+ Reply to Thread
Results 1 to 4 of 4

Applying a formula only to the first date in a month

Hybrid View

  1. #1
    Registered User
    Join Date
    08-21-2013
    Location
    Oklahoma City
    MS-Off Ver
    Excel 2010
    Posts
    0

    Applying a formula only to the first date in a month

    I have a row of pay dates, B7-B36, each two weeks apart, e.g. 5/4/12, 5/18/12, 6/1/12, etc. I also have a row of values (E7-E36) that I want to pull from another cell (B3), but I only want the value to show up on the first pay period of each month. What formula can I use so that the calculated number only shows up if it's the first pay period of the month, and otherwise shows "0"?

    Thanks!

    Terrell
    Attached Files Attached Files
    Last edited by HRCoord; 08-21-2013 at 03:59 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    07-17-2005
    Location
    Abergavenny, Wales, UK
    MS-Off Ver
    XL2003, XL2007, XL2010, XL2013, XL2016
    Posts
    608

    Re: Applying a formula only to the first date in a month

    Hi

    In C8
    =IF(MONTH(B8)=MONTH(B7),"",(D8*80)+SUM(E8:H8))

    and copy down
    --
    Regards
    Roger Govier
    Microsoft Excel MVP

  3. #3
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Applying a formula only to the first date in a month

    Array formula

    =IF(A7=MIN(IF((MONTH($A$7:$A$36)=MONTH(A7))*(YEAR($A$7:$A$36)=YEAR(A7)),$A$7:$A$36)),$B$2*80,"")

    ...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.
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  4. #4
    Forum Expert ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2010
    Posts
    2,952

    Re: Applying a formula only to the first date in a month

    In cell E8 try:

    =IF(MONTH(B8)=MONTH(B7),0,$B$2*80)
    autofill down.
    Would you like to say thanks? Please click the: " Add Reputation" button, on the grey bar below the post.

+ 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] Formula assistance needed to sum data based on anniversary date and month date
    By lilsnoop in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-28-2012, 11:18 PM
  2. Replies: 5
    Last Post: 10-04-2012, 07:06 AM
  3. Replies: 3
    Last Post: 01-18-2008, 09:09 PM
  4. formula for prior month & year of a month end date.
    By mikeburg in forum Excel General
    Replies: 2
    Last Post: 09-25-2007, 04:01 PM
  5. Replies: 3
    Last Post: 09-25-2007, 10:26 AM

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