ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Pulling a date in the current month (https://www.excelbanter.com/excel-worksheet-functions/51966-pulling-date-current-month.html)

Brian

Pulling a date in the current month
 
What I am trying to do is get my excel SS to pull any dates within the
current month for payments. I would likethe cell to say something like "if
cell A1 is in this month, display the date in B2, otherwise take the date
from B3".
I have come up with =IF(A1=DATE(YEAR(NOW()),MONTH(NOW()),),B2,B3), but I am
obviously having a problem without a day entered, it always gives the date in
B3. Any help would be appreciated. thx.

Peo Sjoblom

Pulling a date in the current month
 
One way

=IF(MONTH(A1)=MONTH(TODAY()),B2,B3)


If you want to test for years as well

=IF(DATE(YEAR(A1),MONTH(A1),DAY(TODAY()))=TODAY(), B2,B3)


--

Regards,

Peo Sjoblom

"Brian" wrote in message
...
What I am trying to do is get my excel SS to pull any dates within the
current month for payments. I would likethe cell to say something like "if
cell A1 is in this month, display the date in B2, otherwise take the date
from B3".
I have come up with =IF(A1=DATE(YEAR(NOW()),MONTH(NOW()),),B2,B3), but I

am
obviously having a problem without a day entered, it always gives the date

in
B3. Any help would be appreciated. thx.




Dave Peterson

Pulling a date in the current month
 
One mo

=IF(text(a1,"yyyymm")=text(TODAY(),"yyyymm"),B2,B3 )

Brian wrote:

What I am trying to do is get my excel SS to pull any dates within the
current month for payments. I would likethe cell to say something like "if
cell A1 is in this month, display the date in B2, otherwise take the date
from B3".
I have come up with =IF(A1=DATE(YEAR(NOW()),MONTH(NOW()),),B2,B3), but I am
obviously having a problem without a day entered, it always gives the date in
B3. Any help would be appreciated. thx.


--

Dave Peterson


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

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