Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / December 2006

Tip: Looking for answers? Try searching our database.

Count amount of different dates & amounts of them.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
egibberate - 06 Dec 2006 21:15 GMT
Is this really a new user group :-)
I guess I'm a slow learner :-(

Hi,
    I have a column with Dates from the current Month, in non sequential
order & repeated many times over & with blank cells inbetween  in some rows
(awaiting data)

04/12/06
01/12/06

03/12/06

04/12/06
02/12/06
01/12/06
05/12/06
05/12/06

02/12/06
                 I want my code to search the column to find out how many
different dates there are & count how many instances of each of those dates
there are.Will the first part of this need to be a function that is called?
If so, where & how do I store the function? Please be patient, brand new at
this & getting no younger, but need a little guidance when my textbook
'Excel VBA in Easy Steps' leaves me wanting!
Bob Phillips - 06 Dec 2006 21:43 GMT
Assuming the data is in A1:A13.

In C1, enter

=IF(A1="","",IF(COUNTIF($A$1:A1,A1)>1,"",ROW()))

In D1, enter

=IF(ISERROR(SMALL(C:C,ROW(A1))),"",
INDEX(A:A,MATCH(SMALL(C:C,ROW(A1)),C:C,0)))

and format as a date,

In E1, enter

=IF(D1="",D1,COUNTIF(A:A,D1))

Copy C1:E1 down.

Signature

---
HTH

Bob

(change the xxxx to gmail if mailing direct)

> Is this really a new user group :-)
> I guess I'm a slow learner :-(
[quoted text clipped - 22 lines]
> brand new at this & getting no younger, but need a little guidance when my
> textbook 'Excel VBA in Easy Steps' leaves me wanting!
egibberate - 08 Dec 2006 22:36 GMT
Thanks once again for your help Bob. Very much appreciated & educating me
along the way!
> Assuming the data is in A1:A13.
>
[quoted text clipped - 41 lines]
>> brand new at this & getting no younger, but need a little guidance when
>> my textbook 'Excel VBA in Easy Steps' leaves me wanting!
egibberate - 10 Dec 2006 20:22 GMT
Thanks again Bob for the advice,
                                                 It works perfectly on my
spreadsheet & I will learn from it. I've been experimenting with VBA codes
over the weekend with regards to this particular problem but I guess it's
beyond my current level of knowledge.
                             I can't fathom out, without writing monstrous
amounts of code, how to search a column of data & return how many different
data values there are in Visual Basic rather than excel formula. ie. 40
items of 'Date' data but only 9 different dates. The excel autofilter makes
it look so easy!?! I guess the answer is why make things difficult, just use
formula & include the result in code.
                                                                           
                                                                           
                                                                           
                                 Thank you again.

> Assuming the data is in A1:A13.
>
[quoted text clipped - 41 lines]
>> brand new at this & getting no younger, but need a little guidance when
>> my textbook 'Excel VBA in Easy Steps' leaves me wanting!

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.