#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 40
Default Sales Schedule

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,
--
Howard
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,696
Default Sales Schedule

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

"Jim May" wrote:

in article , Howard at
wrote on 9/22/08 3:25 PM:

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


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 40
Default Sales Schedule

Sandy Mann,

Hey, it worked!. Thanks very much. Now I just have to understand it.
--
Howard


"Sandy Mann" wrote:

Does:

=IF(OR(D1-C1<=365,AND(OR(DAY(DATE(YEAR(C1),2,29))=29,(DAY(DA TE(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


Replace @mailinator.com with @tiscali.co.uk


"Sean Timmons" wrote in message
...
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...

"Jim May" wrote:

in article
, Howard at
wrote on 9/22/08 3:25 PM:

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








  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,345
Default Sales Schedule

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


Replace @mailinator.com with @tiscali.co.uk


"Howard" wrote in message
...
Sandy Mann,

Hey, it worked!. Thanks very much. Now I just have to understand it.
--
Howard


"Sandy Mann" wrote:

Does:

=IF(OR(D1-C1<=365,AND(OR(DAY(DATE(YEAR(C1),2,29))=29,(DAY(DA TE(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


Replace @mailinator.com with @tiscali.co.uk


"Sean Timmons" wrote in message
...
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...

"Jim May" wrote:

in article
, Howard
at
wrote on 9/22/08 3:25 PM:

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









Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculating sales commission that changes based on a sales volume Elbowes Excel Worksheet Functions 2 June 8th 07 02:48 PM
Sales Invoicing linked to Sales ledger(Accounts Receivable) Cache Excel Discussion (Misc queries) 0 May 15th 07 03:41 PM
Add Sales Goals to Sales Report in Pivot Table Ronster Excel Discussion (Misc queries) 1 October 13th 06 04:17 AM
sales needed to cover costs that increase as sales do donna-LexusWebs Excel Worksheet Functions 5 August 29th 06 06:17 PM


All times are GMT +1. The time now is 09:09 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"