+ Reply to Thread
Results 1 to 8 of 8

Using IF Formula with Dates

  1. #1
    Registered User
    Join Date
    09-07-2013
    Location
    Delhi, India
    MS-Off Ver
    Excel 2010
    Posts
    4

    Using IF Formula with Dates

    Hello Everyone, here is my problem statement.

    I have certain dates spanning several years in column A.

    I want to display only the Month and Year in Column B from the date mentioned in column A

    Eg:
    A1 has 09-Jul-13
    A2 has 09-Aug-13,
    A3 has 13-Feb-2014.

    B1 should show Jul-13
    B2 should show Aug-13
    B3 should show Feb-14

    I have been trying the IF forumla but have not been able to make it work. Can someone help me out with the correct IF formula or any other way by which I can achieve the above result.

    Thank You

  2. #2
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,309

    Re: Using IF Formula with Dates

    Change the celformat to 'MMM-YY'
    Willem
    English is not my native language sorry for errors
    Please correct me if I'm completely wrong

  3. #3
    Registered User
    Join Date
    09-07-2013
    Location
    Delhi, India
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Using IF Formula with Dates

    Thanks, that solves part of the problem. However my ultimate objective is to create a pivot table out of Column B which tell me how many dates fall under a particular month, however when i use your solution it does not help. Let me explain.

    Eg:
    A1 has 09-Jul-13
    A2 has 11-Jul-13,
    A3 has 13-Feb-2014
    A4 has 21-Feb-2014
    A5 has 25-Feb-2014

    When I change the format
    B1 is now showing Jul-13
    B2 is now showing Jul-13
    B3 is now showing Feb-14
    B4 is now showing Feb-14
    B5 is now showing Feb-14

    Now I want to create a Pivot Table which should show count against Jul-13 as 2 and Feb-14 as 3, however the pivot table picks up the exact date instead of month and shows me the below output

    09-Jul-13 - 1
    11-Jul-13 - 1
    13-Feb-2014 - 1
    21-Feb-2014 - 1
    25-Feb-2014 - 1

    But i want it to show

    July-13 - 2
    Feb-14 - 3

    Quote Originally Posted by popipipo View Post
    Change the celformat to 'MMM-YY'

  4. #4
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Using IF Formula with Dates

    Hi,

    Have you tried using the Group feature in the Pivot Table (right-click, Group, Months)?

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  5. #5
    Registered User
    Join Date
    09-07-2013
    Location
    Delhi, India
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Using IF Formula with Dates

    Thanks, Again that helps solve only a part of the problem.

    As I mentioned I have dates spanning several years and if i have a date in the same month of different years say 21-Feb-13 and 15-Feb-2014 the Pivot just shows count of 2 against Feb whereas i am expecting it to show count 1 against Feb-13 and count 1 against Feb-14


    Quote Originally Posted by XOR LX View Post
    Hi,

    Have you tried using the Group feature in the Pivot Table (right-click, Group, Months)?

    Regards

  6. #6
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Using IF Formula with Dates

    Then group it in Months and Years!!

  7. #7
    Registered User
    Join Date
    09-07-2013
    Location
    Delhi, India
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Using IF Formula with Dates

    Thanks a lot, That works. It separates the years.

    Is there anyway i can get it to display Feb-13, Feb-14 instead of the way it shows right now.

    Right now it shows

    2013
    Feb-1

    2014
    Feb-1

    I want it to show

    Feb-13 - 1
    Feb-14 - 1

    Quote Originally Posted by XOR LX View Post
    Then group it in Months and Years!!

  8. #8
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Using IF Formula with Dates

    Not exactly, unless you overwrite the entries. The closest approximation I can think of is:

    Highlight one of the years. Right-click. Move/Move Years to Right.

    Then highlight one of the months. Right-click. Field Settings/Layout & Print/Show item labels in tabular form/Repeat item labels.

    Regards

+ 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. Check dates in range either same dates or different dates by formula
    By breadwinner in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-12-2013, 07:42 AM
  2. Replies: 1
    Last Post: 11-01-2012, 03:41 PM
  3. Workday Formula-Notice dates and Expiry dates
    By lamjoey in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 07-24-2011, 06:52 AM
  4. Replies: 3
    Last Post: 07-19-2010, 01:02 PM
  5. [SOLVED] Formula for dates-hire dates of employees
    By shunt in forum Excel General
    Replies: 2
    Last Post: 01-24-2006, 07:15 PM

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