+ Reply to Thread
Results 1 to 11 of 11

formula that looks at cell and if it contains text it moves up and looks again

  1. #1
    Forum Contributor
    Join Date
    05-22-2007
    Location
    Laguna Beach, CA
    Posts
    142

    formula that looks at cell and if it contains text it moves up and looks again

    I trade the futures market and I keep tract of my trades.

    I'm stumped on trying to figure out how to look at a column of cells and if the contents contains "text" move to the next cell up and look again.

    Once it finds a number, displays that number (it could be a negative number or a positive number).

    Thanks
    Attached Files Attached Files

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: formula that looks at cell and if it contains text it moves up and looks again

    Try this...
    =INDEX(C5:C16,COUNT(C5:C16))
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Contributor
    Join Date
    05-22-2007
    Location
    Laguna Beach, CA
    Posts
    142

    Re: formula that looks at cell and if it contains text it moves up and looks again

    It worked perfectly, thanks.

    In trying to understand the formula, could you explain how it looks for numbers vs text?

    Thanks.

  4. #4
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: formula that looks at cell and if it contains text it moves up and looks again

    Here's another one:

    =LOOKUP(2,1/(C5:C16<>"x"),C5:C16)

    The formula from post #2 counts the number of numerical values in C5:C16. In your sample, that count is 5.
    The INDEX function then pulls the 5th value from the range C5:C16, which is C9.
    Since C9=1, the formula will result in 1.

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: formula that looks at cell and if it contains text it moves up and looks again

    COUNT() only counts numbers while COUNTA() counts everything

    This will work AS LONG AS you dont have any other text mixed in the the values above. If that could be the case, 63's suggestion would be better

  6. #6
    Forum Contributor
    Join Date
    05-22-2007
    Location
    Laguna Beach, CA
    Posts
    142

    Re: formula that looks at cell and if it contains text it moves up and looks again

    Both of the formulas worked.

    I don't plan on having mixed text but just in case, the 2nd suggestion might be best.

    I appreciate both of your suggestions.

    Thanks.

    Bruce

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: formula that looks at cell and if it contains text it moves up and looks again

    Happy to help

  8. #8
    Forum Contributor
    Join Date
    05-22-2007
    Location
    Laguna Beach, CA
    Posts
    142

    Re: formula that looks at cell and if it contains text it moves up and looks again

    One quick question:

    Here's my formula as it applies (its displays the correct #):

    =LOOKUP(2,1/(R7:R116<>""),R7:R116)

    Here's my formula as it applies if I copy it over the the next column its (its "not" displaying anything):

    =LOOKUP(2,1/(S7:S116<>""),S7:S116)

    Suggestions?

  9. #9
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: formula that looks at cell and if it contains text it moves up and looks again

    Both of those formulas should return the value of the last cell that is not blank.

    Is this what you are looking to do?

    If you post a sample sheet showing the issue, we can take a look at it.

  10. #10
    Forum Contributor
    Join Date
    05-22-2007
    Location
    Laguna Beach, CA
    Posts
    142

    Re: formula that looks at cell and if it contains text it moves up and looks again

    I figured it out.

    I had " " vs "" in the cell results.

    Thanks again.

    P.S. I didn't realize "" would leave the cell blank....LOL!

  11. #11
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: formula that looks at cell and if it contains text it moves up and looks again

    Glad you figured it out.

    Yes, " " leaves a space and "" leaves the cell blank.

    Thanks for the rep!

+ 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: 8
    Last Post: 05-03-2019, 09:10 AM
  2. Newbie in need of help!: Formula on a dynamic cell which moves
    By sugarjames in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-02-2013, 12:53 PM
  3. Replies: 2
    Last Post: 05-20-2011, 10:54 PM
  4. Import Text moves columns
    By djblois1 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-08-2010, 03:48 PM
  5. Excel 2007 : text moves over
    By givenchi in forum Excel General
    Replies: 5
    Last Post: 03-23-2010, 06:06 PM
  6. Text Box Moves When Printing
    By DaFonz01 in forum Excel General
    Replies: 0
    Last Post: 03-09-2010, 10:02 AM
  7. Text Form Field moves my text?
    By Rick-O-Shay in forum Word Formatting & General
    Replies: 1
    Last Post: 02-23-2010, 07:44 PM
  8. Hyperlink-link so that when a cell moves the link also moves?
    By peters in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-15-2006, 01:30 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