+ Reply to Thread
Results 1 to 6 of 6

How to find the first cell in a row with a date

  1. #1
    Registered User
    Join Date
    02-20-2010
    Location
    Altadena, CA
    MS-Off Ver
    Excel 2007
    Posts
    3

    How to find the first cell in a row with a date

    I have a table which, across the top, has different cell titles, say "Category" in A1, "Budget" in B1, and C1 through F1 are date values.

    I need a formula which will return "C1", because it's the left-most cell in the first row which contains a date.

    I know I can find a date with ISNUMBER or the TYPE functions. But I cannot get TYPE to work on an array.

    Honestly, I can't even understand the behavior of TYPE. Let's say B1 contains a string, and B2:B8 contain numbers.

    If I select one cell and do TYPE(B1:B8) and press enter, I get "2", because B1 contains text.

    If I change B1 to a number, the TYPE cell returns "16", which means error. Wha....?

    If I instead press CTRL+SHIFT+ENTER on the TYPE cell, I get "64", which is the array type. So obviously this is not doing what I want it to do (which is to run the function TYPE on each of the cells B1 through B8)

    With ISNUMBER, I can get the array functionality, but I want to find the *first* numerical cell, not if each cell is a number.
    Last edited by pelesl; 02-20-2010 at 08:26 PM.

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

    Re: How to find the first cell in a row with a date

    You can use a MATCH Array or use a MATCH with embedded INDEX

    =MATCH(TRUE,INDEX(ISNUMBER($B$1:$B$8),0),0)

    Or conversely if the number is always the first value after the last text value you could possibly use a MATCH construct along the lines of:

    =1+MATCH(REPT("Z",255),$B$1:$B$8)

    but again the above assumes no blanks interspersed between text & number and no text after numbers (ie a contiguous listing of text n times, numerics n times)

  3. #3
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: How to find the first cell in a row with a date

    C1 through F1 are date values.

    I need a formula which will return "C1", because it's the left-most cell in the first row which contains a date.
    Your explanation lacks clarity. What do you mean you want to return C1?
    If it is always the first cell on the row to contain a date then you can directly reference the cell in your formula.

    It would help if you clearly explained what you are trying to accomplish within the context of the workbook.
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  4. #4
    Registered User
    Join Date
    02-20-2010
    Location
    Altadena, CA
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: How to find the first cell in a row with a date

    Quote Originally Posted by DonkeyOte View Post
    You can use a MATCH Array or use a MATCH with embedded INDEX

    =MATCH(TRUE,INDEX(ISNUMBER($B$1:$B$8),0),0)
    Thanks. This did exactly what I needed.

    Synthesizing such formula statements seems to be quite a challenge. I hope I can learn a bit at least from examples like these.

  5. #5
    Registered User
    Join Date
    02-20-2010
    Location
    Altadena, CA
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: How to find the first cell in a row with a date

    Quote Originally Posted by pelesl View Post
    Thanks. This did exactly what I needed.
    How do I mark threads as solved? And is there still a mechanism for rating responses?

  6. #6
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: How to find the first cell in a row with a date

    To acknowledge a post, click the scales icon in the gray title bar of the post, next to the alert icon.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ 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