View Single Post
  #12   Report Post  
Posted to microsoft.public.excel.programming
Jimbo213 Jimbo213 is offline
external usenet poster
 
Posts: 30
Default Find Space from Right [in cell formula]



Thank you Chip.
How would you modify that to find the SECOND space from the right?

--
Thanks for your reply & assistance.
Jimbo213


"Chip Pearson" wrote:

If the string to test is in A1, use the following array formula:

=MAX((MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1)="
")*ROW(INDIRECT("1:"&LEN(A1))))

It will return the position of the last space in the text in cell A1.
If there is no space, it returns 0. If A1 is empty, you'll get a #REF
error.

Since this is an array formula, you must press CTRL SHIFT ENTER rather
than just ENTER when you first enter the formula and whenever you edit
it later. If you do this properly, Excel will display the formula
enclosed in curly braces { }. You do not type in the curly braces --
Excel inserts them automatically. For much more information about
array formulas, see www.cpearson.com/Excel/ArrayFormulas.aspx.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


On Thu, 25 Jun 2009 12:54:03 -0700, Jimbo213
wrote:


I found a Jan 5 2009 post to find the FIRST space from the right using the
InStrRev function. I'd like to incorporate this in a cell's formula, not a
VBA function.

Is that possible?