Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Feilds into Buckets Jan-Mar or Apr-Jun

Status
Not open for further replies.

TJVFree

Technical User
Nov 22, 2010
236
US
I’m trying to find the correct formula to put my accounts into “Buckets”

so with the dates showing below, they would fall into either bucket one, bucket two, or Bucket three, and if and if there was one that didn’t fall into any of these buckets it would just say N/A

Bucket One
2/10/2008
2/22/2008
2/25/2008
3/6/2008
3/12/2008

Bucket Two
4/5/2008
4/5/2008
4/15/2008
5/24/2008

Bucket 3
6/9/2008
7/15/2008
7/15/2008
8/5/2008
8/23/2008

N/A
125.14
10/10.23

If anyone can give me some advice on how I can put together a formula that would do what I’m asking.

Thank you for your time and help, it’s greatly appreciated

TCB
 
Have a look at case statements.

Code:
select case when something between a and b then bucketa
            when something between c and d then bucketb
            else somethingelse
            end

Works perfectly with your data set.

I love deadlines. I like the whooshing sound they make as they fly by
Douglas Adams
(1952-2001)
 
This code doesnt seem to being working. should it would in VBA?
 

It wasn't designed to work, it was just to point you in the direction of case statements.

Have a look at Case in books online and you should be able to work it all out from there.

I love deadlines. I like the whooshing sound they make as they fly by
Douglas Adams
(1952-2001)
 
And if you're delving into BOL, you might want to bring up the page on the ISDATE function to help sift the garbage into bucket "N/A".

soi là, soi carré
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top