Determine value if a date is with two date

Hello, I need to determine the Annual Salary at the time a bonus was given. There's a bonus date and a sal begin and end date.  If the bonus date falls between the sal begin and end date then I need the Annual Date reflected in Column E for each EEID.  Please see attached example.  

There are two sets of data
1) EEID, Date of Bonus and bonus amount
2) EEID, Sal Beg Date, Sal End Date and Annual Salary Amount
compensation2.xlsx
ablove3Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
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.

Wayne Taylor (webtubbs)Commented:
Use this formula in cell E2 and copy down...

=SUMPRODUCT((H1:H178=A2)*(I1:I178<=B2)*(J1:J178>=B2),K1:K178)
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
Don VonderBurgPresident/CEOCommented:
Use the AND function with IF

=IF(AND(B2>=I2,B2<=J2),K2,0)

Open in new window

0
Rob HensonFinance AnalystCommented:
I believe you can use this formula:

=SUMIFS($K:$K,$H:$H,$A2,$I:$I,"<="&$B2,$J:$J,">="&$B2)

However, that gives a different result for the first entry (as does Wayne's suggestion) but I believe our results are correct as the $210,000 does not correspond with the dates.

EEID 1 was earning $194,828 between 03/03/07 and 29/02/08 and the bonus was on 29/02/08 so should have result of $194,828

Thanks
Rob
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

ablove3Author Commented:
Thank you so much for resolving this so quickly. Both of Wayne Taylor and Rob Hensons' solutions worked perfectly.  Rob you are correct $210K was an oversight on my part.
0
ablove3Author Commented:
Thank you both so much.  Sorry for taking so long to close this ticket.
0
Rob HensonFinance AnalystCommented:
You have marked your own comment as Assisted.

Can I ask that you Request Attention to reassign points?

Thanks
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.