formula to exclude dates outside current year

Hello Experts
I am trying to create a formula that counts the quantity of "Y"s in column A, subracting (or discounting) from that total, the count of rows with dates in column B earlier than 1/1/current year) AND subtracting dates after 12/31/current year).    I have attached the file with formulas I have tried with no joy.
Thanks in advance,
Berry
formula-excludes-dates-includes-.xlsx
Berry MetzgerLean process improvement consultantAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

byundtMechanical EngineerCommented:
Berry,
Try a COUNTIFS formula like:
=COUNTIFS(tblHolidays[Use?],"Y",tblHolidays[Date],">=" & DATE(YEAR(TODAY()),1,1),tblHolidays[Date],"<=" & DATE(YEAR(TODAY()),12,31))

Brad
0
byundtMechanical EngineerCommented:
Or a SUMPRODUCT:
=SUMPRODUCT((tblHolidays[Use?]="Y")*(tblHolidays[Date]>=DATE(YEAR(TODAY()),1,1))*(tblHolidays[Date]<=DATE(YEAR(TODAY()),12,31)))

The attached file shows both the SUMPRODUCT and COUNTIFS formulas.
formula-excludes-datesQ28271337.xlsx
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Berry MetzgerLean process improvement consultantAuthor Commented:
You nailed it Brad!
Now I have two formulas, not just one, to add to my knowledge base.
I chose to use the SUMPRODUCT formula as I understand it has less overhead than COUNTIFS
Thanks a lot
Berry
0
byundtMechanical EngineerCommented:
Berry,
For what it's worth, the converse is true: COUNTIFS and SUMIFS impose less calculation burden than SUMPRODUCT.

Brad
0
Berry MetzgerLean process improvement consultantAuthor Commented:
Thanks for that Brad.  I was assuming all "IF" formulas were volatile, and because INDEX is not for instance and is faster than multiple IF()s, that any formula with "IF" had more burden.  Good to know.
Thanks much again,
Berry
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.