+ Reply to Thread
Results 1 to 16 of 16

display a single cell text from a range

  1. #1
    Registered User
    Join Date
    04-04-2009
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    3

    display a single cell text from a range

    Hi, 1st post for me this one as I have always managed to fanny my way around a problem.

    Bit stuck with this one though. May be just a bit tired and brain not switched on?

    Anyway, here goes...

    I have a column of 20 cells. Only 1 of them has text in it. I want to scan down this column of cells and display at the bottom (i.e.cell 21) the text which is in the 1 cell that has text.
    Only 1 cell in the column will have text at a time. I dont want a macro so a formula in the 21st cell would be great.

    Anyone help.

    Thanks in advance.

    Royal Blue.
    Last edited by royal blue; 04-04-2009 at 05:52 PM. Reason: bad title

  2. #2
    Registered User
    Join Date
    12-16-2006
    Location
    Bangkok
    MS-Off Ver
    Excel 2003
    Posts
    98

    Re: Simple request - probably

    assuming your list start at row 2 in column A with header in row 1
    try

    =LOOKUP("istext",A2:A20)

    HTH

    cheers, francis

  3. #3
    Registered User
    Join Date
    04-04-2009
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Simple request - probably

    thanks for the quick reply...however, I don't know what the text is in the cell. this means I cant do a specific text search. All I know is there will be some sort of text in one of the range.

  4. #4
    Forum Contributor mewingkitty's Avatar
    Join Date
    09-29-2008
    Location
    Fort McMurray, Alberta, Canada
    MS-Off Ver
    Excel 2003
    Posts
    949

    Re: Simple request - probably

    There's definitely a more eloquent way to do this, but it's all I've got for now :P see attached worksheet.

    Oh, if you wanted to display the text, replace row 21 with :
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by mewingkitty; 04-04-2009 at 04:02 PM.
    =IF(AND(OR(BLONDE,BRUNETTE,REDHEAD),OR(MY PLACE,HER PLACE),ME),BOW-CHICKA-BOW-WOW,ANOTHER NIGHT ON THE INTERNET)

  5. #5
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988

    Re: Simple request - probably

    Royal Blue,

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    Please amend title as explained above if you wish to continue this thread

    Many thanks
    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  6. #6
    Registered User
    Join Date
    12-16-2006
    Location
    Bangkok
    MS-Off Ver
    Excel 2003
    Posts
    98

    Re: Simple request - probably

    have you try the formula provided?

    place the formula in the 21st cell of your range
    the formula works based on your first post mentioning that there will be one cell contain text for the range

    cheers, francis

  7. #7
    Forum Contributor mewingkitty's Avatar
    Join Date
    09-29-2008
    Location
    Fort McMurray, Alberta, Canada
    MS-Off Ver
    Excel 2003
    Posts
    949

    Re: Simple request - probably

    Eh...
    I tried that formula, gives an error for everything in the alphabet after the letter "i"??

    I wouldn't mind knowing what actually causes that.
    Last edited by mewingkitty; 04-04-2009 at 05:16 PM.

  8. #8
    Registered User
    Join Date
    04-04-2009
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    3

    Need to display a single cell text from a range

    OK. Sorry about the title. Better now I hope?

    Anyway, thanks for your help guys. I have used the match and indirect formulas as shown and it works a treat.

    I know where to visit first next time I need help.

    Royal.

  9. #9
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988

    Re: Need to display a single cell text from a range

    You need to update the first post which I will do for you now

    VBA Noob

  10. #10
    Registered User
    Join Date
    12-16-2006
    Location
    Bangkok
    MS-Off Ver
    Excel 2003
    Posts
    98

    Re: Simple request - probably

    Eh...
    I tried that formula, gives an error for everything in the alphabet after the letter "i"??


    the formula works fine for a cell with text in a range with numbers,
    both yours and mine return the same solution the op have asked.
    I have attached a sample for your review

    HTH

    cheers, francis
    Attached Files Attached Files

  11. #11
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: display a single cell text from a range

    try
    =INDEX(A2:A20,MATCH("*",A2:A20,-1))
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  12. #12
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: display a single cell text from a range

    If you use Francis' formula then the lookup value needs to be something "greater" than any text that might be in the range so, to cover all eventualities

    =LOOKUP(REPT("z",255),A1:A20)

    although this would probably be sufficient

    =LOOKUP("zzz",A1:A20)

    Edit: I didn't realise that this has effectively been answered here
    Last edited by daddylonglegs; 04-05-2009 at 08:56 AM.

  13. #13
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: display a single cell text from a range

    whenever looking for last text value in range use REPT("Z",255) as criteria... when looking for last numeric value it is safest to use 9.99999999999999E+307 ...

    if you want to return ROW of last value use MATCH if you want value use LOOKUP ..

    in both cases the binary search algorithm is employed so the criteria should exceed all known values to ensure the last is returned (hence use of BigText and BigNum criteria)

    EDIT: this is just echoing dll's post.

  14. #14
    Forum Contributor mewingkitty's Avatar
    Join Date
    09-29-2008
    Location
    Fort McMurray, Alberta, Canada
    MS-Off Ver
    Excel 2003
    Posts
    949

    Re: display a single cell text from a range

    Um, Franciz...
    Your example starts with an i. If you change that i to a j, the formula returns an error. I had no idea why that was happening, so I asked for some help here:
    http://www.excelforum.com/excel-gene...cognition.html

    I'm not sayin', I'm just sayin'.

  15. #15
    Registered User
    Join Date
    12-16-2006
    Location
    Bangkok
    MS-Off Ver
    Excel 2003
    Posts
    98

    Re: display a single cell text from a range

    Hi Mew

    I didn't realised that as I did my testing, I believed that I must have used text that
    were smaller than istext.
    Thanks for pointing out and the new thread you have posted.
    I read that and it's eye-opening for me, especially the links provided.

    cheers, francis

  16. #16
    Forum Contributor mewingkitty's Avatar
    Join Date
    09-29-2008
    Location
    Fort McMurray, Alberta, Canada
    MS-Off Ver
    Excel 2003
    Posts
    949

    Re: display a single cell text from a range

    For sure, that's why I brought the info back here.
    I had no idea what your formula was doing... being able to ask them peoples on here that know Excel inside out is the only reason I know anything about it at all!

    mew!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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