+ Reply to Thread
Results 1 to 3 of 3

Date Swapping Formula

  1. #1
    Forum Contributor
    Join Date
    08-23-2013
    Location
    Alberta, Canada
    MS-Off Ver
    Excel 365
    Posts
    166

    Date Swapping Formula

    Hey Guys/Gals,
    I have been using a date swap formula to basically swap the month and day between "/" slashes.

    =IF(ISTEXT(C7),DATE(RIGHT(C7,4),LEFT(C7,SEARCH("/",C7)-1),MID(C7,SEARCH("/",C7)+1,2)),DATEVALUE(TEXT(C7,"mm/dd/yyyy")))

    I originally was working on the formula for sample dates such as: 2/28/2023
    But the problem now is; I am running across dates that have the YEAR as just 2-digits, such as: 2/28/23
    The result is some of my new dates are coming in as 2/28/23 = Feb 2, 1923. Is there anyway I could make it so it would have this always in the millennium? Such as: 2/28/23 or 2/28/2023 equaling = 28/2/2023.

    Can you help? Thanks

  2. #2
    Registered User
    Join Date
    04-01-2019
    Location
    HK
    MS-Off Ver
    2010
    Posts
    32

    Re: Date Swapping Formula

    Change your formula to:

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    08-23-2013
    Location
    Alberta, Canada
    MS-Off Ver
    Excel 365
    Posts
    166

    Re: Date Swapping Formula

    Thanks EF!

+ 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. Swapping columns to rows using formula.
    By woytazeit in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-18-2018, 04:17 AM
  2. [SOLVED] Swapping symbol "." for "/" without changing the date format
    By alxes in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-12-2017, 11:28 AM
  3. [SOLVED] Userform Date Swapping Issue
    By stevefisher85 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-22-2016, 07:46 AM
  4. Name swapping
    By EgoBrain90 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-29-2015, 01:19 AM
  5. swapping rows
    By lgbingham in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-20-2013, 04:40 PM
  6. [SOLVED] VBA code swapping date formats??
    By cjimmy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-06-2012, 06:09 AM
  7. swapping columns??
    By Johnny D in forum Excel General
    Replies: 0
    Last Post: 02-15-2006, 03:20 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