+ Reply to Thread
Results 1 to 6 of 6

Dynamic IF Depending on Date.

  1. #1
    Registered User
    Join Date
    10-27-2010
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2010
    Posts
    18

    Dynamic IF Depending on Date.

    I hope someone can help...

    I log each time an asset is passed by me. In column order, it is Date/Call Number/Location/Asset Number. A simple "=CountIF($D$2:$D$10000,Dx) x being whichever line.

    Works great and has for a year. But now I need to add a column adjacent that does the same thing except only go back as far as one year from the date entered into column "A" of that line. This would give me a view of the total times the asset has been sent to me and how many time in the year of the date logged.

    I've hit a snag as I cant get "IF" to go back only 365 days of column "A". I either get an answer of 0 or the total from the column if not an Error.

    Can anyone get me pass this block?

    Much appreciated for anyone assistance.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Dynamic IF Depending on Date.

    How about:

    =COUNTIF($D$2:$D$10000, ">=" & Dx-365)
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    10-27-2010
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2010
    Posts
    18

    Re: Dynamic IF Depending on Date.

    Column D has the "Asset Information" and Column A has the date logged. I need it to count column D IF the date in column A is less than 365 days old. Subtracting 365 from column D would be inaccurate. should I attach a sample of my file?

    Oh and thanks for the reply!

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Dynamic IF Depending on Date.

    Perhaps:

    =SUMPRODUCT(--($A$2:$A$10000>=TODAY()-365), --($D$2:$D$10000=Dx))

  5. #5
    Registered User
    Join Date
    10-27-2010
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2010
    Posts
    18

    Re: Dynamic IF Depending on Date.

    WOW! I think that did it. Using "Today()" rather than trying to subtract from the "A" column. This will be accurate on the day I enter it but can't be used for historical values as it would change when the "Today()" changes. But that is not so important as knowing the day I enter the information and know the last years history of the asset. Works for me! Cheers JB

    Thanks for your support and prompt replies.

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Dynamic IF Depending on Date.

    You can replace the TODAY() reference with another fixed cell reference like M1 where you enter the date you want to be the END of the year range. Then you can put today's date or any date in cell M1.

    =SUMPRODUCT(--($A$2:$A$10000>=$M$1-365), --($D$2:$D$10000=Dx))

+ 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