ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   ingnoring day in date frmat (https://www.excelbanter.com/excel-discussion-misc-queries/64019-ingnoring-day-date-frmat.html)

mostakimm

ingnoring day in date frmat
 

hi all

i am trying to use the conditional formating by comparing two cells,
both are date formated but one is *may-1-06* and the othe is
*may-9-06*, i would like to compare only the month and year, it sould
not matter what day of the month, so the above date should match in my
conditional formation.

mybe there is a way to change all the -days- in all the dates to be
the same, like the first of the month.

any idea, VB solution:rolleyes: .

thank you all.
marwan


--
mostakimm
------------------------------------------------------------------------
mostakimm's Profile: http://www.excelforum.com/member.php...o&userid=20025
View this thread: http://www.excelforum.com/showthread...hreadid=499482


Steve Yandl

ingnoring day in date frmat
 
If you have a date in A1,
=DATE(YEAR(A1),MONTH(A1),1)
should return the date for the first of the month for the month and year the
date in A1 represents.

Steve


"mostakimm" wrote in
message ...

hi all

i am trying to use the conditional formating by comparing two cells,
both are date formated but one is *may-1-06* and the othe is
*may-9-06*, i would like to compare only the month and year, it sould
not matter what day of the month, so the above date should match in my
conditional formation.

mybe there is a way to change all the -days- in all the dates to be
the same, like the first of the month.

any idea, VB solution:rolleyes: .

thank you all.
marwan


--
mostakimm
------------------------------------------------------------------------
mostakimm's Profile:
http://www.excelforum.com/member.php...o&userid=20025
View this thread: http://www.excelforum.com/showthread...hreadid=499482




Dave Peterson

ingnoring day in date frmat
 
Maybe you can use something like:

=TEXT(A1,"yyyymm")=TEXT(B1,"yyyymm")

in your conditional formatting formula.

mostakimm wrote:

hi all

i am trying to use the conditional formating by comparing two cells,
both are date formated but one is *may-1-06* and the othe is
*may-9-06*, i would like to compare only the month and year, it sould
not matter what day of the month, so the above date should match in my
conditional formation.

mybe there is a way to change all the -days- in all the dates to be
the same, like the first of the month.

any idea, VB solution:rolleyes: .

thank you all.
marwan

--
mostakimm
------------------------------------------------------------------------
mostakimm's Profile: http://www.excelforum.com/member.php...o&userid=20025
View this thread: http://www.excelforum.com/showthread...hreadid=499482


--

Dave Peterson

intruder9

ingnoring day in date frmat
 

If you use this it will give you the number of months between the 2
dates and you could use this number foir conditional formating
=DATEDIF(A1,B1,"ym")


--
intruder9
------------------------------------------------------------------------
intruder9's Profile: http://www.excelforum.com/member.php...o&userid=30107
View this thread: http://www.excelforum.com/showthread...hreadid=499482


intruder9

ingnoring day in date frmat
 

Sorry should have been =DATEDIF(A1,B1,"m")


--
intruder9
------------------------------------------------------------------------
intruder9's Profile: http://www.excelforum.com/member.php...o&userid=30107
View this thread: http://www.excelforum.com/showthread...hreadid=499482


mostakimm

ingnoring day in date frmat
 

Thnk you all for the great help :)


--
mostakimm
------------------------------------------------------------------------
mostakimm's Profile: http://www.excelforum.com/member.php...o&userid=20025
View this thread: http://www.excelforum.com/showthread...hreadid=499482



All times are GMT +1. The time now is 12:42 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com