Results 1 to 4 of 4

Thread: Comparison of dates if reference cell is empty

  1. #1
    Join Date
    Jan 2009
    Posts
    88

    Comparison of dates if reference cell is empty

    I have the below formula:

    = SUMPRODUCT ((YEAR ('Database Statistics'! $ F $ 2: $ F $ 999) <= $ A31) * ('Database Statistics' "T $ 2: T $ 999))-SUMPRODUCT ((YEAR ( 'Database Statistics'! $ G $ 2: $ G $ 999) <= $ A31) * ( 'Database Statistics' "T $ 2: T $ 999))
    making a total of T column for years at or below a reference year in column A and subtracted from the total values of column T if in column G, a date entered is equal to or less that same year reference.

    This works, provided in column G, all dates are informed.

    Currently, this column is partially filled with a date 31/12/2025, but to avoid this "trick", I would do without my dates and leave empty if they are not really valid.

  2. #2
    Join Date
    May 2008
    Posts
    860

    Re: Comparison of dates if reference cell is empty

    Try adding the condition of the cell is not empty.
    = SUMPRODUCT ((YEAR ( 'Database Statistics'! $ F $ 2: $ F $ 999) <= $ A31) * ( 'Database Statistics' "$ G $ 2: $ G $ 999> 0) * (YEAR ( 'Database Statistics'! $ G $ 2: $ G $ 999) <= $ A31) * 'Database Statistics' "T $ 2: T $ 999)

  3. #3
    Join Date
    Jan 2009
    Posts
    88

    Re: Comparison of dates if reference cell is empty

    I also tried adding a SUMPRODUCT to test this condition, but still the same issue. Basically, in the sheet if the empty cells in column G are complemented with a "bogus" date (31.12.2025 emerging from a comparison) then it is ok, columns B through F to the piece Statistics return the correct values. If not informed, the results are not valid.

  4. #4
    Join Date
    May 2008
    Posts
    860

    Re: Comparison of dates if reference cell is empty

    Then i think you should try this:

    = SUMPRODUCT ((YEAR ( 'Database Statistics'! $ F $ 2: $ F $ 322) <= $ A6) * 'Database Statistics'! S $ 2: S $ 322) - SUMPRODUCT(( 'Database Statistics' "$ G $ 2: $ G $ 322> 0) * (YEAR ( 'Database Statistics' "$ G $ 2: $ G $ 322) <= $ A6) * 'Database Statistics'! S $ 2: S $ 322)

Similar Threads

  1. Replies: 2
    Last Post: 23-02-2012, 07:23 PM
  2. How to avoid cell reference changes after sorting in Excel
    By Wisaal in forum MS Office Support
    Replies: 2
    Last Post: 09-02-2012, 07:23 PM
  3. insert picture in excel 2007 based on cell reference
    By joe.polkendare in forum Windows Software
    Replies: 5
    Last Post: 25-07-2011, 11:40 PM
  4. Change a cell reference using VBA
    By Emmett in forum Software Development
    Replies: 5
    Last Post: 16-02-2010, 10:33 PM
  5. Cell Reference in Excel
    By kamina23 in forum Windows Software
    Replies: 4
    Last Post: 07-10-2009, 11:53 PM

Tags for this Thread

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
  •  
Page generated in 1,713,401,035.65440 seconds with 17 queries