+ Reply to Thread
Results 1 to 11 of 11

Looking to auto populate a new column with month numbers using dates shown in another cell

Hybrid View

  1. #1
    Registered User
    Join Date
    11-09-2014
    Location
    England
    MS-Off Ver
    2007
    Posts
    5

    Looking to auto populate a new column with month numbers using dates shown in another cell

    In Excel I have cells in column C that have dates showing every month from the 05.12.13 through to 05.10.14 the fifth day of every month being the deadline date. I wanted to poplulate another column next to these dates (column D) as :

    05.12.13 = month 8
    05.01.14 = month 9
    05.02.14 = month 10
    05.03.14 = month 11
    05.04.14 = month 12
    05.05.14 = month 1
    05.06.14 = month 2
    eg...all the way to..
    05.10.14 = month 6

    month 1 starts from 05.05 and ends 05.04 every year.

    how do I make the new column D populate with the month numbers in a macro??
    Last edited by nutbolt; 11-09-2014 at 11:06 AM. Reason: have macro to do conditional formatting would love to know how to include this?

  2. #2
    Forum Expert boopathiraja's Avatar
    Join Date
    07-12-2013
    Location
    Coimbatore,TamilNadu, India
    MS-Off Ver
    Excel 2007, 2013, 2016, 365
    Posts
    1,455

    Re: Looking to auto populate a new column with month numbers using dates shown in another

    Hi, Welcome to the forum

    Apply this in d1 and drag it down

    Formula: copy to clipboard
    =MONTH(EDATE(C1-4,-4))
    Click just below left if it helps, Boo?ath?

  3. #3
    Registered User
    Join Date
    02-09-2014
    Location
    New York
    MS-Off Ver
    Excel 2013
    Posts
    84

    Re: Looking to auto populate a new column with month numbers using dates shown in another

    Month.xlsx

    Try this see attached.

    IF(MONTH(C6)-4<=0,MONTH(C6)-4+12,MONTH(C6)-4)

  4. #4
    Registered User
    Join Date
    11-09-2014
    Location
    England
    MS-Off Ver
    2007
    Posts
    5

    Re: Looking to auto populate a new column with month numbers using dates shown in another

    Quote Originally Posted by vogel997 View Post
    Attachment 357677

    Try this see attached.

    IF(MONTH(C6)-4<=0,MONTH(C6)-4+12,MONTH(C6)-4)
    yes this worked well thanks. How do I get it to populate in cell range d2 to d50??

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Looking to auto populate a new column with month numbers using dates shown in another

    Based onthe samples you provided (and your location), I have a feeling those are not dates, but text looking like dates. Test with =isnumber(cell-ref) FALSE = text, and you will need to convert to dates befor you can do anything else
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  6. #6
    Registered User
    Join Date
    11-09-2014
    Location
    England
    MS-Off Ver
    2007
    Posts
    5

    Re: Looking to auto populate a new column with month numbers using dates shown in another

    Your right fdibbens. The dates come from SAP netweaver so at the end of the macro adjusted to format columns in date format.
    Last edited by nutbolt; 11-10-2014 at 06:47 PM.

  7. #7
    Registered User
    Join Date
    11-09-2014
    Location
    England
    MS-Off Ver
    2007
    Posts
    5

    Re: Looking to auto populate a new column with month numbers using dates shown in another

    Will do some great googling

  8. #8
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Looking to auto populate a new column with month numbers using dates shown in another

    This might be what you are looking for. Enter in D1 or other column formatted as General and copy down.

    Formula: copy to clipboard
    ="Month "&MONTH(EDATE(SUBSTITUTE(C1,".","/")*1,-4))
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  9. #9
    Forum Expert boopathiraja's Avatar
    Join Date
    07-12-2013
    Location
    Coimbatore,TamilNadu, India
    MS-Off Ver
    Excel 2007, 2013, 2016, 365
    Posts
    1,455

    Re: Looking to auto populate a new column with month numbers using dates shown in another

    it that case you can adopt the formula in post # 8 by Mr Newdoverman with a small tweak

    Formula: copy to clipboard
    ="Month "&MONTH(EDATE(SUBSTITUTE(C1,".","/")*1-4,-4))

  10. #10
    Registered User
    Join Date
    11-09-2014
    Location
    England
    MS-Off Ver
    2007
    Posts
    5

    Re: Looking to auto populate a new column with month numbers using dates shown in another

    Quote Originally Posted by boopathiraja View Post
    it that case you can adopt the formula in post # 8 by Mr Newdoverman with a small tweak

    Formula: copy to clipboard
    ="Month "&MONTH(EDATE(SUBSTITUTE(C1,".","/")*1-4,-4))
    okay thanks for all replies will give them a try

  11. #11
    Forum Expert boopathiraja's Avatar
    Join Date
    07-12-2013
    Location
    Coimbatore,TamilNadu, India
    MS-Off Ver
    Excel 2007, 2013, 2016, 365
    Posts
    1,455

    Re: Looking to auto populate a new column with month numbers using dates shown in another

    Quote Originally Posted by nutbolt View Post
    In Excel I have cells in column C that have dates showing every month from the 05.12.13 through to 05.10.14 the fifth day of every month being the deadline date. I wanted to poplulate another column next to these dates (column D) as :
    So if the give date is 04.12.2013 = you want the month number as 7 isn't it ?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 2
    Last Post: 07-31-2013, 02:00 PM
  2. [SOLVED] Help with a system to auto populate month names based on current month
    By rosboy in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-01-2012, 05:17 PM
  3. [SOLVED] Auto populate cells from data in a 6 month range starting with the current month
    By ecarnley349 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-21-2012, 07:32 PM
  4. [SOLVED] Auto populate dates of a month based on dropdown selection
    By tstruntz in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-20-2012, 10:10 AM
  5. Replies: 3
    Last Post: 02-28-2012, 11:54 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1