Identify a range of cells containing dates

  • Thread starter Thread starter RJSohn
  • Start date Start date
R

RJSohn

I need a formula that will identify a range of cells that contain dates
related to rows of data. (example: A1..A52 contain dates, find the las
3 months worth of entries, calculated from a cell that contains <today
functio
 
RJSohn said:
I need a formula that will identify a range of cells that contain dates,
related to rows of data. (example: A1..A52 contain dates, find the last
3 months worth of entries, calculated from a cell that contains <today>
function

One interp and an example to illustrate ..

Suppose we have real dates expected within say: A1:A1000, with corresponding
numeric values (eg sales figs) input within B1:B1000

Then if we want to calc a running total sales for the last 30 days
(inclusive today), we could put in say, C1:

=SUMPRODUCT(($A$1:$A$1000>=DATE(YEAR(TODAY()),MONTH(TODAY())-3,DAY(TODAY())))*($A$1:$A$1000<=TODAY()),$B$1:$B$1000)

The core expression which determines the qualifying "range" of dates within
A1:A1000 is given by the part:

($A$1:$A$1000>=DATE(YEAR(TODAY()),MONTH(TODAY())-3,DAY(TODAY())))*($A$1:$A$1000<=TODAY())

which evaluates to an array of 1's/0's depending on whether the dates
qualify or not

The "range" may be contiguous or discontiguous depending on whether the
inputs within A1:A1000 are sequentially made or not. This is immaterial in
the example application above.

---
 
RJSohn said:
I need a formula that will identify a range of cells that contain dates,
related to rows of data. (example: A1..A52 contain dates, find the last
3 months worth of entries, calculated from a cell that contains <today>
function

One interp and an example to illustrate ..

Suppose we have real dates expected within say: A1:A1000, with corresponding
numeric values (eg sales figs) input within B1:B1000

Then if we want to calc a running total sales for the last 30 days
(inclusive today), we could put in say, C1:

=SUMPRODUCT(($A$1:$A$1000>=DATE(YEAR(TODAY()),MONTH(TODAY())-3,DAY(TODAY())))*($A$1:$A$1000<=TODAY()),$B$1:$B$1000)

The core expression which determines the qualifying "range" of dates within
A1:A1000 is given by the part:

($A$1:$A$1000>=DATE(YEAR(TODAY()),MONTH(TODAY())-3,DAY(TODAY())))*($A$1:$A$1000<=TODAY())

which evaluates to an array of 1's/0's depending on whether the dates
qualify or not

The "range" may be contiguous or discontiguous depending on whether the
inputs within A1:A1000 are sequentially made or not. This is immaterial in
the example application above.

---
 
Typo in earlier response just detected ..

Lines:
Then if we want to calc a running total sales for the last 30 days
(inclusive today), we could put in say, C1:

should have read as:
Then if we want to calc a running total sales for the last 3 months
(inclusive today), we could put in say, C1:

Formula's OK, though <g>

---
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top