Results 1 to 6 of 6

Thread: Return a comment based on values in another cell

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Administrator Admin's Avatar
    Join Date
    Mar 2011
    Posts
    1,123
    Rep Power
    10
    Assume your Invoice number in A2, in B2

    =TEXT(TEXT(--("20"&MID(A2,MIN(FIND({0,1,2,3,4,5,6,7,8,9},A2&"01 23456789")),4)&"01"),"0000\/00\/00")+0,"mmm yy")
    Cheers !

    Excel Range to BBCode Table
    Use Social Networking Tools If You Like the Answers !

    Message to Cross Posters

    @ Home - Office 2010/2013/2016 on Win 10 (64 bit); @ Work - Office 2016 on Win 10 (64 bit)

  2. #2
    Forum Guru Rick Rothstein's Avatar
    Join Date
    Feb 2012
    Posts
    662
    Rep Power
    15
    Quote Originally Posted by Admin View Post
    Assume your Invoice number in A2, in B2

    =TEXT(TEXT(--("20"&MID(A2,MIN(FIND({0,1,2,3,4,5,6,7,8,9},A2&"01 23456789")),4)&"01"),"0000\/00\/00")+0,"mmm yy")
    Here is a similar formula that is eight characters and one fuction call less than the formula you posted..

    =TEXT(0+(20&REPLACE(MID(A1,MIN(FIND({0,1,2,3,4,5,6 ,7,8,9},A1&"0123456789")),4),3,0,"-")&"-01"),"mmm yy")

    I would note, though, that one could put this even shorter formula in the cell (saves another 15 characters and one more function call)...

    =0+(20&REPLACE(MID(A1,MIN(FIND({0,1,2,3,4,5,6,7,8, 9},A1&"0123456789")),4),3,0,"-")&"-01")

    and simply Custom Format the cells using "mmm yy" (without the quote marks, of course)... doing it that way, the cells will contain real dates, instead of Text that looks like a date, and which can be used directly in other formulas if need be.
    Last edited by Rick Rothstein; 05-23-2015 at 09:06 AM.

Similar Threads

  1. Vlookup to Return Multiple Values
    By Admin in forum Download Center
    Replies: 9
    Last Post: 02-17-2017, 07:03 PM
  2. Replies: 4
    Last Post: 09-23-2013, 10:41 AM
  3. Replies: 2
    Last Post: 05-30-2013, 07:28 PM
  4. Replies: 8
    Last Post: 04-16-2013, 02:04 PM
  5. Replies: 1
    Last Post: 04-24-2012, 09:55 PM

Posting Permissions

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