×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

#### Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

# Add if greater than/equal Start Date And Less then/equal Stop Date

## Add if greater than/equal Start Date And Less then/equal Stop Date

(OP)
I need a formula to count

# of majors for past 5 years by school year.

For example if a major has a start date of 4/27/17 and the stop date is null I would need to count the major in the school year 8/1/2017 - 7/31/2018 and the school year 8/1/2017 - 7/31/2018.

Also if a major has a start date of 8/21/2103 and the stop date is 8/24/2015 I would need to count the major in the school year 8/1/2013 - 7/31/2018 and the school year 8/1/2013 - 7/31/2014, 8/1/2014 - 7/31/20158/1/2015 - 7/31/2016

### RE: Add if greater than/equal Start Date And Less then/equal Stop Date

Start by creating a School Year formula, using the current school year (as named by the ending year):

//{@currSY}:
Year(currentdate+153)

Then create one formula for each of five years, like this:

//{@currentYr}:
If (
isnull({table.stopdt}) or
{table.stopdt}>=date({@currSY}-1,8,1)
) and
{table.startdt}<date({@currSY},8,1) then
1

//{@LastYr}:
If (
Isnull({@table.stopdt}) or
{table.stopdt}>=date{@currSY-2,8,1)
) and
{table.startdt}<date({@currSY}-1,8,1) then
1

Repeat for three remaining years. Then you can insert summaries (sums, not counts) on each formula.

-LB

#### Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

#### Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Close Box

# Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!