# Coverting Month text to a Number

#### proctk

##### Well-known Member
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

### Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

You can use
=MONTH(B5)

#### Joe4

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
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

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.

Replies
5
Views
246
Replies
10
Views
2K
Replies
2
Views
398
Replies
8
Views
2K
Replies
2
Views
569

1,181,785
Messages
5,932,037
Members
436,815
Latest member

### 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.

### Which adblocker are you using?

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

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