+ Reply to Thread
Results 1 to 7 of 7

Position of Last Upper Case Letter found

  1. #1
    Forum Contributor
    Join Date
    02-22-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    102

    Position of Last Upper Case Letter found

    Hello,

    would require help to have a formula which can help to identify the position of Last Upper case letter in a cell
    Example:

    A1: This IS A Example ( This should give 11 as "E" in example is the last Upper case letter in the cell)

    Thanks.

  2. #2
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Position of Last Upper Case Letter found

    Try the following Code. You could use 'Regular Expressions' if your search criteria
    were a little more complicated. See http://www.macrostash.com/2011/10/08...for-excel-vba/

    Please Login or Register  to view this content.

  3. #3
    Valued Forum Contributor TheCman81's Avatar
    Join Date
    11-06-2012
    Location
    Edinburgh, UK
    MS-Off Ver
    Excel 2003, 2007, 2010, 2013
    Posts
    346

    Re: Position of Last Upper Case Letter found

    Not the most elegent of formulas but this works:

    =MAX(IF(IFERROR(IF(FIND(IF(MID(A1,ROW($1:$99),1)<>" ",MID(A1,ROW($1:$99),1)),UPPER(MID(A1,ROW($1:$99),1))),ROW($1:$99)),FALSE)<=LEN(A1),ROW($1:$99)))
    Excel Guru in the making

    <----------If the question has been answered to your satisfication please click the Add Repuation star to the left

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Position of Last Upper Case Letter found

    Here's another one.

    Your formula will return an incorrect result if there are non-letter characters in the string (if that's a possibility). For example:

    I don't like onions.
    You Owe Us $100

    This array formula accounts for non-letter chars.

    =MAX(IF(ABS(CODE(MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1))-77.5)<13,ROW(INDIRECT("1:"&LEN(A1)))))

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

    If the referenced cell is empty then you'll get a #REF! error which can be accounted for if needed.

    There may also be instances where the formula will return 0 meaning no uppercase letters are present. If you don't want a result of 0 this can also be accounted for if needed.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

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

    Re: Position of Last Upper Case Letter found

    Really nice, Tony.

    I particularly like the use of ABS and < as one condition in place of two (< and >). Excellent stuff.
    Click * below if this answer helped

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

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Position of Last Upper Case Letter found

    Thanks!

  7. #7
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Position of Last Upper Case Letter found

    NVM - did not work with repetition.

+ 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] Convert 1st letter of word to Upper Case and rest to lower case
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-23-2013, 11:44 AM
  2. [SOLVED] first letter small case & all letter capital case any coding / any trick / any formula
    By sonu_kumar444 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-22-2012, 05:22 AM
  3. List first letter upper case
    By Bob Frolek in forum Excel General
    Replies: 9
    Last Post: 09-02-2005, 03:05 AM
  4. Replies: 14
    Last Post: 08-25-2005, 10:05 PM
  5. [SOLVED] How do I change Letter case (lower to Upper) in a spreadsheet???
    By mineisjosh in forum Excel General
    Replies: 4
    Last Post: 02-19-2005, 10:06 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