Sales Schedule

H

Howard

c1 Date Sold
d1 Date Acquired
e1 Proceeds
f1 Cost Basis

To determine if the capital gain/loss is short-term, I can use this formula:
IF(C1-D1<=365,C1-D1,0); however that won't work for a leap year. A short-term
gain/loss is one year or less. What forumula would I use?

Thanks,
 
J

Jim May

IF(C1-D1<=365,C1-D1,0)

Maybe you can do something with this formula that determines either the 366
or the 365 day year.

=IF(MOD(YEAR(C1),4)=0,366,365)

Good Luck,

Jim May
 
S

Sean Timmons

this is a puzzler. Difficulty with the below is does not account for cases
where D1 is a leap year and the end date is past February. We can get there
using lots of if statements, but isn't there a less obfuscated way than that?

Also, technically, we'd have to account for years such as 1900, 2100, et.
al. that are not leap years...
 
S

Sandy Mann

Does:

=IF(OR(D1-C1<=365,AND(OR(DAY(DATE(YEAR(C1),2,29))=29,(DAY(DATE(YEAR(D1),2,29)=29))),D1-C1=366)),D1-C1,0)

do what you want? There may be more elegant solutions.

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings

(e-mail address removed)
Replace @mailinator.com with @tiscali.co.uk
 
S

Sandy Mann

The problem resoves itself down to is testing for a period or 365 days or
less with the sole exception of 366 days *provided* that the 366 days
includes February 29th.

I therefore check for 365 days or less OR 366 days with one of the years
having a February 29th.

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings

(e-mail address removed)
Replace @mailinator.com with @tiscali.co.uk
 

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

Similar Threads

Sales Schedule 3
plus and minus 6
Formula for Payment Schedule 1
Rolling totals 1
Employee Turnover 1
Excel Quirk or my ignorance? 4
Combining complex data 12
summing formula 3

Top