+ Reply to Thread
Results 1 to 5 of 5

Display first open column letter/row number

  1. #1
    Registered User
    Join Date
    11-12-2012
    Location
    Michigan
    MS-Off Ver
    Excel 2010
    Posts
    48

    Display first open column letter/row number

    Alrighty here...

    I have a short little function that tells me the value of the first available row. IE if my sheet looks like this:

    ...A B C D E
    1 X
    2 X
    3 X
    4
    5

    It will return the number 4 because 4 is the first available number in the column that is blank. The formula looks like this:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    So that works up and down... What if I want the letter of the first available column from left to right, whereas the above example would return the letter B? Is that possible?

    Basically if I changed the code to:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    It would display a B (or C if B was filled, etc)...

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

    Re: Display first open column letter/row number

    you could try
    =ADDRESS(A1:X1,MATCH(TRUE,INDEX(ISBLANK(A1:AX1),0,0),0),2) but if you want to remove the cell number then
    =LEFT(ADDRESS(A1:X1,MATCH(TRUE,INDEX(ISBLANK(A1:AX1),0,0),0),2),FIND("$",ADDRESS(A1:X1,MATCH(TRUE,INDEX(ISBLANK(A1:AX1),0,0),0),2))-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

  3. #3
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Display first open column letter/row number

    Try this...
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  4. #4
    Registered User
    Join Date
    11-12-2012
    Location
    Michigan
    MS-Off Ver
    Excel 2010
    Posts
    48

    Re: Display first open column letter/row number

    @ SixthSense That returns me #N/A if everything is blank. If the value is a number, it remains #N/A.. If I put any text in, it only returns that text. So if my top row is 1,2,7,ELF, it would say ELF.. If my top row was 1,2,7,8,9,100, it would be #N/A.. Very weird...

    @ martindwilson It works, but only if I have a value in cell J1 and the value has to be a number. It can't be text. If I have values all the way up to the I column, i get #Value... If I put any number in J1 above 0, it works. But J1 is the only cell it works in... So I can have a 1 in J1 and it will return A...

    I hope I explained both of those correctly...

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

    Re: Display first open column letter/row number

    opps my mistake
    =LEFT(ADDRESS(ROW(A1:X1),MATCH(TRUE,INDEX(ISBLANK(A1:AX1),0,0),0),2),FIND("$",ADDRESS(ROW(A1:X1),MATCH(TRUE,INDEX(ISBLANK(A1:AX1),0,0),0),2))-1)

    or
    =ADDRESS(ROW(A1:X1),MATCH(TRUE,INDEX(ISBLANK(A1:AX1),0,0),0),2)

+ 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