Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 29
Default Comparing two columns of dates

I'm working in Excel 2007.

I have two columns of dates, the first being a "buy" date and the second
being a "sell" date for the item in that row. If the data is valid, obviously
each date in the second column should be later than the corresponding date in
the first column.

I'd like to create a function that will compare each date in the first
column to the adjacent date in the second column, and tell me if the data is
valid or if there is a date-pair in which the "buy" date falls after the
"sell" date. I don't need this comparison returned for each pair, I just need
to check the columns as a whole and get a "VALID" OR "INVALID" value.

I'm thinking that this needs to be some sort of composite function, maybe
involving a COUNTIF(), but I just can't figure out how to work it.

Thanks for the help!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Comparing two columns of dates

A couple of questions...

Can the sell date be the same as the buy date?

If you haven't sold yet then there probably isn't a sell date entered yet,
correct?


--
Biff
Microsoft Excel MVP


"PaladinWhite" wrote in message
...
I'm working in Excel 2007.

I have two columns of dates, the first being a "buy" date and the second
being a "sell" date for the item in that row. If the data is valid,
obviously
each date in the second column should be later than the corresponding date
in
the first column.

I'd like to create a function that will compare each date in the first
column to the adjacent date in the second column, and tell me if the data
is
valid or if there is a date-pair in which the "buy" date falls after the
"sell" date. I don't need this comparison returned for each pair, I just
need
to check the columns as a whole and get a "VALID" OR "INVALID" value.

I'm thinking that this needs to be some sort of composite function, maybe
involving a COUNTIF(), but I just can't figure out how to work it.

Thanks for the help!



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 29
Default Comparing two columns of dates

No, the sell date can never be the same as the buy date - it should always be
at least a day later.

And every pair is full - there are no missing dates. I.E. every item in this
list has been sold.

"T. Valko" wrote:

A couple of questions...

Can the sell date be the same as the buy date?

If you haven't sold yet then there probably isn't a sell date entered yet,
correct?


--
Biff
Microsoft Excel MVP


"PaladinWhite" wrote in message
...
I'm working in Excel 2007.

I have two columns of dates, the first being a "buy" date and the second
being a "sell" date for the item in that row. If the data is valid,
obviously
each date in the second column should be later than the corresponding date
in
the first column.

I'd like to create a function that will compare each date in the first
column to the adjacent date in the second column, and tell me if the data
is
valid or if there is a date-pair in which the "buy" date falls after the
"sell" date. I don't need this comparison returned for each pair, I just
need
to check the columns as a whole and get a "VALID" OR "INVALID" value.

I'm thinking that this needs to be some sort of composite function, maybe
involving a COUNTIF(), but I just can't figure out how to work it.

Thanks for the help!




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Comparing two columns of dates

Try this:

=IF(SUMPRODUCT(--(A1:A10<B1:B10))=COUNT(A1:A10),"Valid","Invalid")

Note that you can't use entire columns as range references with SUMPRODUCT
unless you're using Excel 2007.

--
Biff
Microsoft Excel MVP


"PaladinWhite" wrote in message
...
No, the sell date can never be the same as the buy date - it should always
be
at least a day later.

And every pair is full - there are no missing dates. I.E. every item in
this
list has been sold.

"T. Valko" wrote:

A couple of questions...

Can the sell date be the same as the buy date?

If you haven't sold yet then there probably isn't a sell date entered
yet,
correct?


--
Biff
Microsoft Excel MVP


"PaladinWhite" wrote in message
...
I'm working in Excel 2007.

I have two columns of dates, the first being a "buy" date and the
second
being a "sell" date for the item in that row. If the data is valid,
obviously
each date in the second column should be later than the corresponding
date
in
the first column.

I'd like to create a function that will compare each date in the first
column to the adjacent date in the second column, and tell me if the
data
is
valid or if there is a date-pair in which the "buy" date falls after
the
"sell" date. I don't need this comparison returned for each pair, I
just
need
to check the columns as a whole and get a "VALID" OR "INVALID" value.

I'm thinking that this needs to be some sort of composite function,
maybe
involving a COUNTIF(), but I just can't figure out how to work it.

Thanks for the help!






  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 29
Default Comparing two columns of dates

Works like a charm - now I get to play around with it and try and figure out
how it works.

Thanks!

"T. Valko" wrote:

Try this:

=IF(SUMPRODUCT(--(A1:A10<B1:B10))=COUNT(A1:A10),"Valid","Invalid")

Note that you can't use entire columns as range references with SUMPRODUCT
unless you're using Excel 2007.

--
Biff
Microsoft Excel MVP


"PaladinWhite" wrote in message
...
No, the sell date can never be the same as the buy date - it should always
be
at least a day later.

And every pair is full - there are no missing dates. I.E. every item in
this
list has been sold.

"T. Valko" wrote:

A couple of questions...

Can the sell date be the same as the buy date?

If you haven't sold yet then there probably isn't a sell date entered
yet,
correct?


--
Biff
Microsoft Excel MVP


"PaladinWhite" wrote in message
...
I'm working in Excel 2007.

I have two columns of dates, the first being a "buy" date and the
second
being a "sell" date for the item in that row. If the data is valid,
obviously
each date in the second column should be later than the corresponding
date
in
the first column.

I'd like to create a function that will compare each date in the first
column to the adjacent date in the second column, and tell me if the
data
is
valid or if there is a date-pair in which the "buy" date falls after
the
"sell" date. I don't need this comparison returned for each pair, I
just
need
to check the columns as a whole and get a "VALID" OR "INVALID" value.

I'm thinking that this needs to be some sort of composite function,
maybe
involving a COUNTIF(), but I just can't figure out how to work it.

Thanks for the help!








  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default Comparing two columns of dates

You're welcome. Thanks for the feedback!

--
Biff
Microsoft Excel MVP


"PaladinWhite" wrote in message
...
Works like a charm - now I get to play around with it and try and figure
out
how it works.

Thanks!

"T. Valko" wrote:

Try this:

=IF(SUMPRODUCT(--(A1:A10<B1:B10))=COUNT(A1:A10),"Valid","Invalid")

Note that you can't use entire columns as range references with
SUMPRODUCT
unless you're using Excel 2007.

--
Biff
Microsoft Excel MVP


"PaladinWhite" wrote in message
...
No, the sell date can never be the same as the buy date - it should
always
be
at least a day later.

And every pair is full - there are no missing dates. I.E. every item in
this
list has been sold.

"T. Valko" wrote:

A couple of questions...

Can the sell date be the same as the buy date?

If you haven't sold yet then there probably isn't a sell date entered
yet,
correct?


--
Biff
Microsoft Excel MVP


"PaladinWhite" wrote in
message
...
I'm working in Excel 2007.

I have two columns of dates, the first being a "buy" date and the
second
being a "sell" date for the item in that row. If the data is valid,
obviously
each date in the second column should be later than the
corresponding
date
in
the first column.

I'd like to create a function that will compare each date in the
first
column to the adjacent date in the second column, and tell me if the
data
is
valid or if there is a date-pair in which the "buy" date falls after
the
"sell" date. I don't need this comparison returned for each pair, I
just
need
to check the columns as a whole and get a "VALID" OR "INVALID"
value.

I'm thinking that this needs to be some sort of composite function,
maybe
involving a COUNTIF(), but I just can't figure out how to work it.

Thanks for the help!








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
Comparing Dates in 4 Columns - Nested Formulas? foofoo Excel Discussion (Misc queries) 2 October 11th 07 10:13 AM
Comparing Dates in 4 Columns - Nested Formulas? foofoo Excel Discussion (Misc queries) 1 October 11th 07 09:39 AM
Comparing Dates fubdap Excel Discussion (Misc queries) 3 September 27th 07 03:53 PM
Comparing two columns of information with 2 new columns of informa cbuck Excel Discussion (Misc queries) 1 January 16th 07 09:49 PM
Comparing dates Debbie F Excel Worksheet Functions 7 September 7th 05 11:57 AM


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

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

About Us

"It's about Microsoft Excel"