+ Reply to Thread
Results 1 to 8 of 8

Assign a sequential number IF a cell contains text

  1. #1
    Registered User
    Join Date
    12-21-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    8

    Assign a sequential number IF a cell contains text

    I want to automatically number cells IF the cell next to it contains text.

    If you look at the image, column V contains some blank cells, some with text. Column U numbers those cells with text sequentially. However, I did this manually and I want it to be automatic.

    What formula (or, more likely, combination of formulas) would I use to return the number?

    If needed, I can enter information into the blank cells, e.g. "FALSE" or "0".

    Thanks so much!

    Capture.JPG

  2. #2
    Registered User
    Join Date
    10-02-2012
    Location
    Baku
    MS-Off Ver
    Excel 2010
    Posts
    273

    Re: Assign a sequential number IF a cell contains text

    Hi
    =IF(ISTEXT(v1),COUNTA($v$1:v1),"")
    then drag down

  3. #3
    Registered User
    Join Date
    12-21-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Assign a sequential number IF a cell contains text

    You've solved all my problems! Thank you so much!

    One edit: Because my cells were in row 5, the formula had to be modified to the following.
    =IF(ISTEXT(V5),COUNTA($V$5:V5),"")

    Question for you: how does that work? In particular, I don't understand the "counta($v$5:v5) portion.

    Again, thank you!

  4. #4
    Registered User
    Join Date
    10-02-2012
    Location
    Baku
    MS-Off Ver
    Excel 2010
    Posts
    273

    Re: Assign a sequential number IF a cell contains text

    Counta formula counts cells that are not empty. when you put $ sign makes cell absolute. So first cell stays abslute and others relative and when you drag down the range will enlarge automatically.
    Istext returns true or false if the cell is text.
    as a result. if the particular cell is text then calculate non empty cell otherwise nothing which is "" sign.

  5. #5
    Registered User
    Join Date
    12-21-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Assign a sequential number IF a cell contains text

    Okay, I didn't know about the absolute vs. relative part. Thank you!

  6. #6
    Registered User
    Join Date
    06-22-2022
    Location
    Istanbul/Turkey
    MS-Off Ver
    MS Office 2016
    Posts
    2

    Re: Assign a sequential number IF a cell contains text

    Quote Originally Posted by e.isayev View Post
    Hi
    =IF(ISTEXT(v1),COUNTA($v$1:v1),"")
    then drag down
    Thanks Isayev. I registered to this forum just because of you

    Regards
    Nedim

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel (Windows 11 64-bit)
    Posts
    63,586

    Re: Assign a sequential number IF a cell contains text

    That's very nice. Be aware that the member in question has not been active here since 2013.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" to anyone who has offered you help in your thread. You can reward them by clicking on * Add Reputation below theur user name on the left, if you wish.


    Forum Rules (updated September 2018): please read them here.
    How to use the Power Query code you've been given: help here. More about the Power suite here.

  8. #8
    Registered User
    Join Date
    06-22-2022
    Location
    Istanbul/Turkey
    MS-Off Ver
    MS Office 2016
    Posts
    2

    Re: Assign a sequential number IF a cell contains text

    I noticed it I will try to be active user for this forum. Regards.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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