Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default Excel date calculation

I have a rather large spreadsheet which tracks hospital patient admissions. I
need to identify only those who are admitted in the current month (say
November), but I am getting all patients admitted in November for prior
years, 2005, 2004, etc.

Is there a function that can look at the entered month/year of admission and
compare it with the current month/year to result in a TRUE condition so that
I may identify these individuals?

Thanks in advance,
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default Excel date calculation

Your very clear statement of the requirement makes this easy:

=IF(AND((MONTH(A1)=11),(YEAR(A1)=YEAR(NOW()))),TRU E,FALSE)
This is good for November.


=IF(AND((MONTH(A1)=MONTH(NOW())),(YEAR(A1)=YEAR(NO W()))),TRUE,FALSE)
This is good for any month
--
Gary's Student


"Jetlag5549" wrote:

I have a rather large spreadsheet which tracks hospital patient admissions. I
need to identify only those who are admitted in the current month (say
November), but I am getting all patients admitted in November for prior
years, 2005, 2004, etc.

Is there a function that can look at the entered month/year of admission and
compare it with the current month/year to result in a TRUE condition so that
I may identify these individuals?

Thanks in advance,

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,886
Default Excel date calculation

Hi

Try
=TEXT(A1,"yyyy mm")=TEXT(NOW(),"yyyy mm")
This will work for all months

--
Regards

Roger Govier


"Jetlag5549" wrote in message
...
I have a rather large spreadsheet which tracks hospital patient
admissions. I
need to identify only those who are admitted in the current month (say
November), but I am getting all patients admitted in November for
prior
years, 2005, 2004, etc.

Is there a function that can look at the entered month/year of
admission and
compare it with the current month/year to result in a TRUE condition
so that
I may identify these individuals?

Thanks in advance,



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 174
Default Excel date calculation

Another way.....

=A1-DAY(A1)=TODAY()-DAY(TODAY())

or to make that simpler set up one cell with the formula

=TODAY()-DAY(TODAY())+1

which will always generate the 1st day of the current month

then, assuming that date is in cell B1 use the formula

=A1-DAY(A1)+1=$B$1

"Jetlag5549" wrote:

I have a rather large spreadsheet which tracks hospital patient admissions. I
need to identify only those who are admitted in the current month (say
November), but I am getting all patients admitted in November for prior
years, 2005, 2004, etc.

Is there a function that can look at the entered month/year of admission and
compare it with the current month/year to result in a TRUE condition so that
I may identify these individuals?

Thanks in advance,

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default Excel date calculation

Works great! Thanks!
Not to be too picky, but is there a way to modify the function to return 1
when the contition is true, and 0 if the condition if false?

"Roger Govier" wrote:

Hi

Try
=TEXT(A1,"yyyy mm")=TEXT(NOW(),"yyyy mm")
This will work for all months

--
Regards

Roger Govier


"Jetlag5549" wrote in message
...
I have a rather large spreadsheet which tracks hospital patient
admissions. I
need to identify only those who are admitted in the current month (say
November), but I am getting all patients admitted in November for
prior
years, 2005, 2004, etc.

Is there a function that can look at the entered month/year of
admission and
compare it with the current month/year to result in a TRUE condition
so that
I may identify these individuals?

Thanks in advance,






  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,886
Default Excel date calculation

Hi

Warp the whole formula within a double unary minus.
This coerces True's to 1 and Falses's to 0
=--(TEXT(D1,"yyyy mm")=TEXT(NOW(),"yyyy mm"))

--
Regards

Roger Govier


"Jetlag5549" wrote in message
...
Works great! Thanks!
Not to be too picky, but is there a way to modify the function to
return 1
when the contition is true, and 0 if the condition if false?

"Roger Govier" wrote:

Hi

Try
=TEXT(A1,"yyyy mm")=TEXT(NOW(),"yyyy mm")
This will work for all months

--
Regards

Roger Govier


"Jetlag5549" wrote in message
...
I have a rather large spreadsheet which tracks hospital patient
admissions. I
need to identify only those who are admitted in the current month
(say
November), but I am getting all patients admitted in November for
prior
years, 2005, 2004, etc.

Is there a function that can look at the entered month/year of
admission and
compare it with the current month/year to result in a TRUE
condition
so that
I may identify these individuals?

Thanks in advance,






  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default Excel date calculation

Awesome!
I have so much to learn.
Thanks for the help
Randy,

"Roger Govier" wrote:

Hi

Warp the whole formula within a double unary minus.
This coerces True's to 1 and Falses's to 0
=--(TEXT(D1,"yyyy mm")=TEXT(NOW(),"yyyy mm"))

--
Regards

Roger Govier


"Jetlag5549" wrote in message
...
Works great! Thanks!
Not to be too picky, but is there a way to modify the function to
return 1
when the contition is true, and 0 if the condition if false?

"Roger Govier" wrote:

Hi

Try
=TEXT(A1,"yyyy mm")=TEXT(NOW(),"yyyy mm")
This will work for all months

--
Regards

Roger Govier


"Jetlag5549" wrote in message
...
I have a rather large spreadsheet which tracks hospital patient
admissions. I
need to identify only those who are admitted in the current month
(say
November), but I am getting all patients admitted in November for
prior
years, 2005, 2004, etc.

Is there a function that can look at the entered month/year of
admission and
compare it with the current month/year to result in a TRUE
condition
so that
I may identify these individuals?

Thanks in advance,






  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,886
Default Excel date calculation

You're very welcome, Randy. Thanks for the feedback.

--
Regards

Roger Govier


"Jetlag5549" wrote in message
...
Awesome!
I have so much to learn.
Thanks for the help
Randy,

"Roger Govier" wrote:

Hi

Warp the whole formula within a double unary minus.
This coerces True's to 1 and Falses's to 0
=--(TEXT(D1,"yyyy mm")=TEXT(NOW(),"yyyy mm"))

--
Regards

Roger Govier


"Jetlag5549" wrote in message
...
Works great! Thanks!
Not to be too picky, but is there a way to modify the function to
return 1
when the contition is true, and 0 if the condition if false?

"Roger Govier" wrote:

Hi

Try
=TEXT(A1,"yyyy mm")=TEXT(NOW(),"yyyy mm")
This will work for all months

--
Regards

Roger Govier


"Jetlag5549" wrote in
message
...
I have a rather large spreadsheet which tracks hospital patient
admissions. I
need to identify only those who are admitted in the current
month
(say
November), but I am getting all patients admitted in November
for
prior
years, 2005, 2004, etc.

Is there a function that can look at the entered month/year of
admission and
compare it with the current month/year to result in a TRUE
condition
so that
I may identify these individuals?

Thanks in advance,








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
Excel 2003 FAILS, but Excel 2000 SUCCEEDS ??? Richard Excel Discussion (Misc queries) 2 May 13th 23 11:46 AM
excel date scheduling not msProject 4pinoy Excel Worksheet Functions 0 November 11th 06 08:33 PM
Add a formated date button for Excel 2002 tool bar Mr. Low Excel Discussion (Misc queries) 1 October 30th 06 04:12 PM
Excel: I enter date and format for date, but shows as number spohar Excel Discussion (Misc queries) 2 March 10th 06 08:40 PM
Excel file modification date GROSNER Excel Discussion (Misc queries) 5 March 4th 05 01:19 AM


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

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"