+ Reply to Thread
Results 1 to 7 of 7

How to reference cell with date in formula

  1. #1
    Registered User
    Join Date
    07-22-2011
    Location
    California
    MS-Off Ver
    Excel 2003
    Posts
    4

    How to reference cell with date in formula

    Hi,

    I have a pretty elaborate spreadsheet for my bills. One cell adds up all the bills due during a specific pay period using named ranges. The formula looks like this:

    =SUMIFS(NextPmtAmt,NextPaymentDueDate,">=9/9/2011",NextPaymentDueDate,"<=9/22/11")

    It works, but when I have to populate cells for upcoming pay periods, I have to go in an edit the dates manually. I'm lazy, and want to simply reference a cell with the date in it instead of typing the whole date out in the formula. What I'd like to do is this:

    A2 contains 9/9/2011
    B2 contains 9/22/2011

    =SUMIFS(NextPmtAmt,NextPaymentDueDate,">=A2",NextPaymentDueDate,"<=B2")

    but it doesn't work. Can anyone help me figure out how to save some time and make this work the way I want it to?

    Thanks so much!
    llj
    Last edited by 4lilprinces; 07-22-2011 at 09:17 PM. Reason: Solved!

  2. #2
    Registered User
    Join Date
    07-22-2011
    Location
    Vancouver, Washington
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Please help - How to reference cell with date in formula

    You could try ">=Text(A2,"m/d/yyyy")" and "<=Text(B2,"m/d/yyyy")" and see if that works. It may not though with the multiple quotes. Do you have an example I could play with to see which way to go?

    Jim

  3. #3
    Registered User
    Join Date
    07-22-2011
    Location
    California
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: How to reference cell with date in formula

    That didn't quite work - I think you're right about the quotes.

    I'm attaching a modified version of my spreadsheet (I only wish these were all my monthly bills!) but it should be enough for you to see what's going on. The paydays are all listed on the right side of the "Summary" worksheet. For the formula, I enter the most recent payday to start, then the upcoming payday minus one day to calculate the pay period. Ideally, I would like to be able to enter (DATE1) and (DATE2-1).

    I really appreciate your help. I keep thinking there has to be a simple solution to this. Lets hope I'm right.
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: How to reference cell with date in formula

    You need to put the cell reference outside the quotes and concatenate like this

    =SUMIFS(NextPmtAmt,NextPaymentDueDate,">="& $A$2,NextPaymentDueDate,"<=" &B2)
    Does that work for you?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  5. #5
    Registered User
    Join Date
    07-22-2011
    Location
    California
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: How to reference cell with date in formula

    Thanks so much!! It worked! I had to tweak it just a little - here's what I ended up with:

    =SUMIFS(NextPmtAmt,NextPaymentDueDate,">="&A1,NextPaymentDueDate,"<="&B1)

    Again, THANK YOU!!

  6. #6
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: How to reference cell with date in formula

    tRY THIS ... I added an asterisk to mark the starting date, play with it..
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: How to reference cell with date in formula

    there was an error in the last macro...

+ 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