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

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
60,192
Office Version
  1. 365
Platform
  1. Windows
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.
 

proctk

Well-known Member
Joined
Dec 24, 2004
Messages
840
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
 

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
60,192
Office Version
  1. 365
Platform
  1. Windows
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.
 

Forum statistics

Threads
1,148,526
Messages
5,747,211
Members
424,068
Latest member
Salim khamis

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
Top