PC Review


Reply
Thread Tools Rate Thread

compare date range with date in columns and input data from another cell

 
 
Tammy Robinson
Guest
Posts: n/a
 
      18th Aug 2011
I have a spreadsheet that includes the following: 2 columns (d and e)
with a beginning and end date, a column with a dollar amount (rent: g)
and. 24 columns across (Jan - Dec for two years:- n - ak). The 24
columns across contain the date ie. (01/01/2012, 02/01/2012, and so
on).

I am wanting to compare the range of D - E with each column across.
When it meets the criteria it will put the amount in G in each column
that is BETWEEN the date range. For example:

if the beginning date is 01/01/2012 (d), the ending date is 06/01/2013
(e), and rent is $3000 (g), I would like Jan - Dec 2012 and Jan - Jun
2013 to be populated with $3000. The remaining columns would be 0.

I have tried the following, but will only work for 2012.



=IF(AND(MONTH($D:$D)<=MONTH(T$9),YEAR($D:$D)<=YEAR(T$9),MONTH($E:
$E)>=MONTH(T$9),YEAR($E:$E)=YEAR(T$9)),$G:$G,0)



What am I doing wrong? Any help is much appreciated.



Thanks
 
Reply With Quote
 
 
 
 
Praxx
Guest
Posts: n/a
 
      18th Aug 2011
On Aug 18, 7:35*am, Tammy Robinson <trobin...@ntsdevco.com> wrote:
> I have a spreadsheet that includes the following: 2 columns (d and e)
> with a beginning and end date, a column with a dollar amount (rent: g)
> and. 24 columns across (Jan - Dec for two years:- n - ak). The 24
> columns across contain the date ie. (01/01/2012, 02/01/2012, and so
> on).
>
> I am wanting to compare the range of *D - E with each column across.
> When it meets the criteria it will put the amount in G in each column
> that is BETWEEN the date range. For example:
>
> if the beginning date is 01/01/2012 (d), the ending date is 06/01/2013
> (e), and rent is $3000 (g), *I would like Jan - Dec 2012 and Jan - Jun
> 2013 *to be populated with $3000. The remaining columns would be 0.
>
> I have tried the following, but will only work for 2012.
>
> =IF(AND(MONTH($D:$D)<=MONTH(T$9),YEAR($D:$D)<=YEAR(T$9),MONTH($E:
> $E)>=MONTH(T$9),YEAR($E:$E)=YEAR(T$9)),$G:$G,0)
>
> What am I doing wrong? Any help is much appreciated.
>
> Thanks


No need to split the month and year to compare, you can compare the
start and end month to the 24 month headers.

=IF(AND($D2<=I$1,$E2>=I$1),$G2,0)

D E F G H I H K L M N
1 Beginning Date End Date Rent 1/1/2012 2/1/2012 3/1/2012 4/1/2012
5/1/2012 6/1/2012 7/1/2012
2 2/1/2012 6/1/2012 3000 0 3000 3000 3000 3000 3000 0

Formatting messing up the alignment but you get the idea.
 
Reply With Quote
 
Tammy Robinson
Guest
Posts: n/a
 
      18th Aug 2011
Praxx - Thanks so much. That seems to do the trick! I have been going
crazy. making it hard then it should be I guess.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
need help with vba code to input data on certain date and move to next cell for the following date. meghantrus@hotmail.com Microsoft Outlook VBA Programming 1 30th May 2007 04:45 PM
Formula for determining if two date columns fall within specific date range Igottabeme Microsoft Excel Worksheet Functions 2 21st Apr 2006 02:50 AM
Formula for determining if two date columns fall within specific date range Igottabeme Microsoft Excel Misc 1 20th Apr 2006 10:03 PM
Input Date when data is entered into another cell =?Utf-8?B?R2FyeUJ5cmQ=?= Microsoft Excel Worksheet Functions 2 1st Feb 2005 12:37 AM
Compare Date in Cell VS a Variable Date to Hide Row =?Utf-8?B?SmltSQ==?= Microsoft Excel Programming 3 10th Oct 2004 04:26 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:35 PM.