Coverting Month text to a Number

proctk

Well-known Member
Joined
Dec 24, 2004
Messages
840
Hi

I want to have a foluma that will pull the month from the =Today() Function

Example it the date is 25-Jan-05 Lotacted in cell B4 then I want the number "1" to be in Cell B5

Once the month changes to Feb then the value in B5 should automaticlly change to 2

Help Please
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Use the MONTH function,

i.e. If you date is in cell A5, then =MONTH(A5)

Be sure to format this cell as a number, not a date.
 
Upvote 0
Thank you for the reply, I should have figured that out Myself

I think that this is a little more challenging

I want to no the number of months that have pased between two dates

I.E. Oct 01 04 to Jan 25 05 represents 117 days

How many have passed

Jan 25 05 is in cell B5 and Oct 01 04 is in cell B4

Thank you once again
 
Upvote 0
Let's say you wanted to subtract the date in cell B1 from the date in A1 and return the number of months difference. This would work:

=((YEAR(A1)-YEAR(B1))*12)+MONTH(A1)-MONTH(B1)


Formatted resulting cell as number.

If there is rounding, you may need to play around with it a little, or use the Day function also to determine whether to add or subtract 1.
 
Upvote 0

Forum statistics

Threads
1,214,606
Messages
6,120,484
Members
448,967
Latest member
visheshkotha

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top