+ Reply to Thread
Results 1 to 6 of 6

Araay gives unpredicted results

  1. #1
    Forum Contributor
    Join Date
    06-29-2005
    Posts
    201

    Araay gives unpredicted results

    Hi all

    The array I have created to find characters in a cell gives unpredictable results:

    Please Login or Register  to view this content.
    The idea is that in given strings I have to determine the positions of different characters
    e.g. a string can be 1.11.11 of 1-1-11 or 1111/3333/444444 etc

    If all dividing characters (as given in the array) are the same the formula works fine

    The problems start when 2 different characters are used in the same string: eg 12.3455-67

    Is there a way to correct this?
    For clearity I have added a demofile

    Thanks in advance
    Hein
    Attached Files Attached Files

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,260

    Re: Araay gives unpredicted results

    You could use the same function for both and just specify which match you want:
    Please Login or Register  to view this content.
    Called with:
    =GetCharacter(E4,1)
    or
    =GetCharacter(E4,2)

    As in your examples, I assumed that if you specify a match number that is greater than the total number of matches, it just returns the last position. (e.g. if you specify 2 and there's only 1 special character, it returns the position of the last one)

    Also, I think that E16 should be 7 not 8 dues to the space between - and /
    Remember what the dormouse said
    Feed your head

  3. #3
    Forum Contributor
    Join Date
    06-29-2005
    Posts
    201

    Re: Araay gives unpredicted results

    Hi Rory,

    Thank you for your valuable contribution, much appreciated!

    Your code works perfectly, all combinations I have tried give the correct results.
    About your last comment: I think that you are right about it, the space is 1 of the character, I made a mistake, sorry.

    I will implement your code and as far as I can see I will use the strTime as the cell vaue, and "hard -code" the 1 and 2 for the 1st and 2nd character

    Once again: thanks
    Hein

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,260

    Re: Araay gives unpredicted results

    Glad to help. Please remember to mark the thread Solved using the Thread Tools link at the top of the page.

  5. #5
    Forum Contributor
    Join Date
    06-29-2005
    Posts
    201

    Re: Araay gives unpredicted results

    I will do that
    I have also added your rep!

  6. #6
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,260

    Re: Araay gives unpredicted results

    Thank you.

+ 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. Replies: 3
    Last Post: 10-30-2013, 09:18 AM
  2. [SOLVED] Display search results inluding results that match patrially
    By RichTea88 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-06-2013, 08:52 AM
  3. [SOLVED] Unable to display mail merge results using Preview Results function
    By trandle in forum Word Formatting & General
    Replies: 1
    Last Post: 05-30-2012, 12:29 AM
  4. Replies: 2
    Last Post: 02-03-2012, 12:13 PM
  5. Replies: 3
    Last Post: 03-31-2010, 11:47 AM

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