How do I create a formula that will do YTD calculations?

G

Guest

I am trying to determine how to write a formula that allows me to calculate
YTD earnings but I cannot figure how to get the year-to-date to work. I know
how to get the number of weeks from one date to another (for example
8/1/05-4/12/06 = 255 days or 36.43 weeks). My issue is that I want the
formula to count only the weeks YTD 1/1/06-4/12/06. I want the formula to
know that if my begin date is in a prior year to only look at the current
years weeks.

Any assistance would be appreciated. I cannot seem to find an easy solution.
 
V

via135

hi!

assuming that the start date is in A1 & end date is in B1, enter
in C1: =(B1-A1)/7 and format C1 as Number.

-via135
 
C

Carim

Hi,

With the same assumptions as via135, in cell C1 :
=IF(YEAR(A1)<YEAR(B1),(B1-(DATE(YEAR(B1),1,1)))/7,(B1-A1)/7)

HTH
Carim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top