LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to Count Months in a Column of Dates


Hello all,

Hope you can assist with a slight problem I've encountered.

I have a large column of date entries (several columns, actually, bu
same applies to all of them).

This column is a Contact Date (and has been named so it can be accesse
by reference as 'contact'), recording when we first interacted with a
individual. It contains values up to ten or so years ago.

There is a report associated with this data, where I need to brea
down, by month, when people contacted us. This information is onl
relevant however to people contacting us in the current financia
year.

At the moment, I have to take the date of contact, pass it through a
AND to see if it falls into the correct year. This obviously leads t
a column of TRUE/FALSEs 1-to-1 related to the contact dates. If it i
TRUE, then I take the Month() value from the contact date. Using
Countif across the column of determined months is used in the repor
(for example,
=countif(contactResults,3)
returns the value for people first seen in March).

I was thinking a VBA script would be able to compress this to a singl
function, except I do not know how to address a column for inpu
purposes. I'm aiming for something akin to the following:


Function newContacts(inputSet As [?], selectedMonth As Integer)
newContacts=0
Do
if ((inputSet[element]=(1st date of fin.year)) AND
(inputSet[element]<=(last date of fin.year)))
then
if month(inputSet[element]) = selectedMonth
then
newContacts = newContacts +1
end if
end if
Loop Until [end of inputSet]
End Function


such that a call to newContacts(contact,3) should return the same a
the nested functions described above. Alternatively, referring int
the function by newContacts(N:N,3) would work well enough (although b
less clear to other users).

Is this possible?

Many thanks in advance

--
Dexsqua
-----------------------------------------------------------------------
Dexsquab's Profile: http://www.excelforum.com/member.php...fo&userid=3096
View this thread: http://www.excelforum.com/showthread.php?threadid=50632

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Formula to count no. of months between 2 dates Melissa Excel Discussion (Misc queries) 5 March 23rd 10 09:18 AM
count the number of months between two dates VKL Narayanan[_2_] Excel Worksheet Functions 3 September 29th 08 05:47 PM
counting dates in a column that less than 6 months from today Kaye Excel Discussion (Misc queries) 2 February 11th 06 07:10 PM
How do I take a column of dates and add six months? tigerswilson Excel Worksheet Functions 2 July 26th 05 06:28 AM
Dates to months and calculating values for their months jigsaw2 Excel Programming 1 September 5th 03 01:35 PM


All times are GMT +1. The time now is 09:18 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"