View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gina[_2_] Gina[_2_] is offline
external usenet poster
 
Posts: 49
Default Please help me with this function? I am struggling..



"Bernie Deitrick" wrote:

Gina,

Select your data table, then choose Data / Pivot Table and Pivot Chart Report... and then click
"Finish"

Drag the button with the distirct names into the Row Field Area, and the button with the "Date"
column heading into the data area - right click the data button and choose "Field Options" and set
that to Max. Format the field for date, and you will have a table that list the latest date for
each District. If you want differences (the number of days), type

=TODAY() - B4

into a cell next to the pivot table, format for number with no decimal places, then drag down to
match your table.

HTH,
Bernie
MS Excel MVP


"Gina" wrote in message
...
The first row of the spreadsheet contains headers.

In Cells D2:D2500 my spreadsheet gives a list of dates specific events occur.

In Cells G2:G2500 my spreadsheet lists the district in which these events
occur.

In Cells C2:C2500 I need to count the # of days since the last event that
occurred within this district.



I am trying to get this formula to work, and can't seem to do it (but thank
you JohnC, I think you've given me an excellent start- if I was better at
this, I'd have probably figured it out and wouldn't need to ask this
question).



=IF(COUNTIF($D$1:$D2,D3)<0,D3-MAX(IF(($G$2:$G$2500=G3)*($D$2:$D$2500<D3),$D$2:$D $2500)),"")





Hi Bernie,
I did try that, and it does give the last date for each district, but that's
not exactly what I need.

What'll happen is that several departments are entering data into this
spreadsheet. It may be entered at times out of chronological order.

I want in Column C a function that will look at the current record-- take
the current date and district, and then look at the entire dataset of 2500
rows and tell me out of those, how many days it's been since the previous
event. I need this calculation for each record.

Then once I get this done, I will in another spreadsheet, go back and query
the max amount of days that any one district has gone between events, and
return that max value into a cell. (we give out awards if certain levels are
met- 30/60/90 days within a calendar year). The data goes back several
years, and will extend several years into the future.