+ Reply to Thread
Results 1 to 5 of 5

Return value in X if date in Y falls between two dates - Help!

  1. #1
    Registered User
    Join Date
    08-12-2010
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    14

    Return value in X if date in Y falls between two dates - Help!

    Hi all

    I am struggling with what feels like it should be a simple solution, and it's frustrating!
    I am collecting data by date and amount, and I want to add the values into the right column on a given table so that I can use it to calculate total amount in a particular month.
    I have attached a simple example sheet to better explain what I mean.
    The formula I am using is: =IF($B$2>=DATE(2012,1,1)<=DATE(2012,1,31),$C$2,0)

    Any help will be greatly appreciated.

    many thanks

    Richard
    Attached Files Attached Files

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Return value in X if date in Y falls between two dates - Help!

    Hi Richard,

    Have you looked at using a AND() or a MONTH() in your formula?
    Easier is a Pivot Table - I'm assuming you have a lot more dates and amounts to deal with. See attached for a simple Pivot. Also Pivots are easier with newer versions of Excel.

    see http://chandoo.org/wp/2009/11/17/gro...-pivot-tables/
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    08-12-2010
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: Return value in X if date in Y falls between two dates - Help!

    I will take a look at that, thank you.
    I need it to work in Excel2003 as that is what the majority of users currently have!

    thanks again.

  4. #4
    Forum Expert icestationzbra's Avatar
    Join Date
    01-07-2004
    MS-Off Ver
    2007, 2010
    Posts
    1,421

    Re: Return value in X if date in Y falls between two dates - Help!

    two different formulae to achieve what you are looking for:

    Please Login or Register  to view this content.
    if i understand your requirement correctly, this could also work:

    Please Login or Register  to view this content.
    - i.s.z -
    CSE, aka Array aka { }, formulae are confirmed with CONTROL+SHIFT+ENTER.
    Replace commas ( , ) with semicolons ( ; ) in formulae, if your locale setting demands.
    All good ideas are courtesy resources from this forum as well as others around the web.
    - e.o.m -

  5. #5
    Registered User
    Join Date
    08-12-2010
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: Return value in X if date in Y falls between two dates - Help!

    #icestationzbra
    Fantastic, second option works a treat, easier to manage aswell. Many thanks.

    I will still look at pivot tables though as I haven't used before.

    Thanks All

    Richard

+ 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