+ Reply to Thread
Results 1 to 3 of 3

Nesting MID Function within =IF; Not able prevent excel from removing zero from formula

  1. #1
    Registered User
    Join Date
    07-21-2020
    Location
    Great Britain
    MS-Off Ver
    2016
    Posts
    9

    Nesting MID Function within =IF; Not able prevent excel from removing zero from formula

    Hi there,

    I'm trying to get excel to calculate a date function using =Mid nested within an =IF formula. What I want it to do is to return the month value as name (e.g Jun nd not 06). However I've run into an issue that so far I've not been able to solve. Excel keeps removing the zero in front of the month to incorrectly return a false answer.

    I have tried;

    Altering the Mid formula to starting searching 1 character before the zero (and increasing the last criteria by 1) in the hope that it would trip excel into remembering to keep the zero; problem is that digit is a hypen so excel thinks its a minus figure which is why excel continues to remove the zero).

    looking at formatting cell option to change the format of the date in the source cell. At the moment I can't get the source cell to do this.

    I am using excel 365. Can anyone help me with this?
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    11-05-2019
    Location
    Tiki Island, TX
    MS-Off Ver
    Office 365
    Posts
    168

    Re: Nesting MID Function within =IF; Not able prevent excel from removing zero from formul

    The trick is to quit using text functions and actually convert the original text to a date by using the datevalue function. Then you can use all of the other date functions to get the values you want. See attached.
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    03-17-2010
    Location
    karachi
    MS-Off Ver
    Excel 2003
    Posts
    113

    Re: Nesting MID Function within =IF; Not able prevent excel from removing zero from formul

    =TEXT(DATEVALUE(E2),"mmm")

+ 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. [SOLVED] Removing excel MAX function without breaking formula
    By jasonfsi in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-17-2017, 09:41 AM
  2. Replies: 4
    Last Post: 02-26-2015, 06:10 AM
  3. [SOLVED] Need assistance on nesting an indirect function in a index / match formula
    By ghosters in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-08-2012, 06:00 AM
  4. [SOLVED] Prevent Excel from removing preceding zeros when importing text
    By NathanC in forum Excel General
    Replies: 7
    Last Post: 09-11-2012, 04:00 PM
  5. Replies: 6
    Last Post: 07-06-2012, 10:18 PM
  6. Removing one or levels of nesting
    By Qualo_Jinn in forum Excel General
    Replies: 6
    Last Post: 09-01-2011, 05:03 PM
  7. Excel Vlookup/Hlookup/nesting function
    By Jones Girl in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-08-2008, 08:00 PM

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