#1   Report Post  
Jack Sons
 
Posts: n/a
Default kind of rank

Merry Christmas to all who read this.

Suppose in a cell I have the following text:

this is my text

In another cell I want a formula that that tells me, when I put the number
12 at a certain spot in that formula, that the 12th character in the text -
so in this case it is the character "t" (spaces etc. are also characters) -
is the 2nd occurrence in the text, so the output of the formula is 2.
If I put 1 into the formula (the first character) the result is 1 (first
occurrence of "t"); if I put in 15 the result will be 3; input 6 results in
2 (second "i"). And so on.
Prefrably with existing worksheet functions only (but I see no way to do it
with find, index, match, rank etc.). If that is impossible a UDF would also
be nice.

I hope I stated my problem clear enough.
Your help will be very much appreciated.

Again, have a nice X'mas (in Holland we have 2 Christmas days, december 25
and 26, like we have 2 Easter days (sunday and monday) and also 2
Pentacostal days - Whitsunday and Whitmonday - we once were a very devout
nation.

Jack Sons
The Netherlands


  #2   Report Post  
Aladin Akyurek
 
Posts: n/a
Default

=LEN(LEFT(A1,B1))-LEN(SUBSTITUTE(LEFT(A1,B1),MID(LEFT(A1,B1),B1,1)," "))

where A1 houses "this is my text" and B1 a position value like 12.

"Jack Sons" wrote in message
...
Merry Christmas to all who read this.

Suppose in a cell I have the following text:

this is my text

In another cell I want a formula that that tells me, when I put the number
12 at a certain spot in that formula, that the 12th character in the
text -
so in this case it is the character "t" (spaces etc. are also
characters) -
is the 2nd occurrence in the text, so the output of the formula is 2.
If I put 1 into the formula (the first character) the result is 1 (first
occurrence of "t"); if I put in 15 the result will be 3; input 6 results
in
2 (second "i"). And so on.
Prefrably with existing worksheet functions only (but I see no way to do
it
with find, index, match, rank etc.). If that is impossible a UDF would
also
be nice.

I hope I stated my problem clear enough.
Your help will be very much appreciated.

Again, have a nice X'mas (in Holland we have 2 Christmas days, december 25
and 26, like we have 2 Easter days (sunday and monday) and also 2
Pentacostal days - Whitsunday and Whitmonday - we once were a very devout
nation.

Jack Sons
The Netherlands




  #3   Report Post  
Leo Heuser
 
Posts: n/a
Default

Hi Jack

Here's one way to do it. Text in A1 and
the number (12, 1, 15, 6 etc.) in F1:

=SUMPRODUCT((MID(A1,ROW(INDIRECT("1:"&F1)),1)=MID( A1,F1,1))+0)

And a merry Christmas to you :-)

--
Best Regards
Leo Heuser

Followup to newsgroup only please.

"Jack Sons" skrev i en meddelelse
...
Merry Christmas to all who read this.

Suppose in a cell I have the following text:

this is my text

In another cell I want a formula that that tells me, when I put the number
12 at a certain spot in that formula, that the 12th character in the

text -
so in this case it is the character "t" (spaces etc. are also

characters) -
is the 2nd occurrence in the text, so the output of the formula is 2.
If I put 1 into the formula (the first character) the result is 1 (first
occurrence of "t"); if I put in 15 the result will be 3; input 6 results

in
2 (second "i"). And so on.
Prefrably with existing worksheet functions only (but I see no way to do

it
with find, index, match, rank etc.). If that is impossible a UDF would

also
be nice.

I hope I stated my problem clear enough.
Your help will be very much appreciated.

Again, have a nice X'mas (in Holland we have 2 Christmas days, december 25
and 26, like we have 2 Easter days (sunday and monday) and also 2
Pentacostal days - Whitsunday and Whitmonday - we once were a very devout
nation.

Jack Sons
The Netherlands




  #4   Report Post  
Jack Sons
 
Posts: n/a
Default

Aladin and Leo,

Thank you both.

Jack.

"Jack Sons" schreef in bericht
...
Merry Christmas to all who read this.

Suppose in a cell I have the following text:

this is my text

In another cell I want a formula that that tells me, when I put the number
12 at a certain spot in that formula, that the 12th character in the

text -
so in this case it is the character "t" (spaces etc. are also

characters) -
is the 2nd occurrence in the text, so the output of the formula is 2.
If I put 1 into the formula (the first character) the result is 1 (first
occurrence of "t"); if I put in 15 the result will be 3; input 6 results

in
2 (second "i"). And so on.
Prefrably with existing worksheet functions only (but I see no way to do

it
with find, index, match, rank etc.). If that is impossible a UDF would

also
be nice.

I hope I stated my problem clear enough.
Your help will be very much appreciated.

Again, have a nice X'mas (in Holland we have 2 Christmas days, december 25
and 26, like we have 2 Easter days (sunday and monday) and also 2
Pentacostal days - Whitsunday and Whitmonday - we once were a very devout
nation.

Jack Sons
The Netherlands




  #5   Report Post  
Leo Heuser
 
Posts: n/a
Default

You're welcome, Jack.

LeoH

"Jack Sons" skrev i en meddelelse
...
Aladin and Leo,

Thank you both.

Jack.





  #6   Report Post  
Kevin
 
Posts: n/a
Default

Right off hand I don't see a way to do this without going
into VBA code. However, you should be able to do it in
VBA.

Kevin
-----Original Message-----
Merry Christmas to all who read this.

Suppose in a cell I have the following text:

this is my text

In another cell I want a formula that that tells me,

when I put the number
12 at a certain spot in that formula, that the 12th

character in the text -
so in this case it is the character "t" (spaces etc. are

also characters) -
is the 2nd occurrence in the text, so the output of the

formula is 2.
If I put 1 into the formula (the first character) the

result is 1 (first
occurrence of "t"); if I put in 15 the result will be 3;

input 6 results in
2 (second "i"). And so on.
Prefrably with existing worksheet functions only (but I

see no way to do it
with find, index, match, rank etc.). If that is

impossible a UDF would also
be nice.

I hope I stated my problem clear enough.
Your help will be very much appreciated.

Again, have a nice X'mas (in Holland we have 2 Christmas

days, december 25
and 26, like we have 2 Easter days (sunday and monday)

and also 2
Pentacostal days - Whitsunday and Whitmonday - we once

were a very devout
nation.

Jack Sons
The Netherlands


.

  #7   Report Post  
Jack Sons
 
Posts: n/a
Default

Kevin,

VBA, of course. But I really wanted to do it with worksheetfunctions. Aladin
en Leo in their posts showed me ways to do it. Nevertheless thank you for
your reaction to my question.

Jack.

"Kevin" schreef in bericht
...
Right off hand I don't see a way to do this without going
into VBA code. However, you should be able to do it in
VBA.

Kevin
-----Original Message-----
Merry Christmas to all who read this.

Suppose in a cell I have the following text:

this is my text

In another cell I want a formula that that tells me,

when I put the number
12 at a certain spot in that formula, that the 12th

character in the text -
so in this case it is the character "t" (spaces etc. are

also characters) -
is the 2nd occurrence in the text, so the output of the

formula is 2.
If I put 1 into the formula (the first character) the

result is 1 (first
occurrence of "t"); if I put in 15 the result will be 3;

input 6 results in
2 (second "i"). And so on.
Prefrably with existing worksheet functions only (but I

see no way to do it
with find, index, match, rank etc.). If that is

impossible a UDF would also
be nice.

I hope I stated my problem clear enough.
Your help will be very much appreciated.

Again, have a nice X'mas (in Holland we have 2 Christmas

days, december 25
and 26, like we have 2 Easter days (sunday and monday)

and also 2
Pentacostal days - Whitsunday and Whitmonday - we once

were a very devout
nation.

Jack Sons
The Netherlands


.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Scatter Graph - Data Label Problems TBD Charts and Charting in Excel 2 January 16th 05 05:08 PM
how do i plot this kind of data TAMM Excel Discussion (Misc queries) 2 December 16th 04 02:49 AM
how do i plot this kind of data using excel TAMM Excel Discussion (Misc queries) 1 December 11th 04 05:35 PM
pivot table - Rank A Lesner Excel Discussion (Misc queries) 4 December 2nd 04 04:53 PM
Rank A Lesner Excel Discussion (Misc queries) 2 December 2nd 04 04:21 PM


All times are GMT +1. The time now is 10:48 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"