+ Reply to Thread
Results 1 to 5 of 5

Limiting characters in one column based on text in another

  1. #1
    Registered User
    Join Date
    03-25-2021
    Location
    Sofia
    MS-Off Ver
    Microsoft Office 365 for Mac
    Posts
    3

    Question Limiting characters in one column based on text in another

    Hi guys!

    So I'm having a bit of an issue:

    I have two columns. In column A, there is text, and it can be either "ABC" or "ABE". In column B, I will have text as well (numbers really, but I want them to be read as text, because they start with 0). I want the text in column B to have limited characters number based on the text in column A.
    So, if in A1 there is "ABC", I want in B1 to be possible to only write exactly 10 characters, and if in A1 there is "ABE", I want in B1 to be possible to write only exactly 9 characters.

    For now what I have done is basically half of it, which limits the character count in my selected space (B1) to exactly 10 characters when it finds the text "ABC" in A1, using data validation:

    =IF(ISERROR(FIND("ABC";A1));999;10)

    However when I try to add the other condition, it doesn't work. I tried adding "OR" in front of "FIND", nothing again. Maybe there is another formula altogether, but I can't recall it.

    Please, help me with that
    Last edited by ivanina2000; 03-26-2021 at 07:42 AM. Reason: SOLVED

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,023

    Re: Limiting characters in one column based on text in another

    Try this as the Data Validation formula:

    =LEN(B1)=IF(A1="ABC",10,9)
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Registered User
    Join Date
    03-25-2021
    Location
    Sofia
    MS-Off Ver
    Microsoft Office 365 for Mac
    Posts
    3

    Re: Limiting characters in one column based on text in another

    Hi! Thanks, however, it works only for the first half again. When there is another text, different from ABC, it still allows only 10 characters.
    EDIT: I opened the table you attached and I saw it works fine, so probably I made a mistake somewhere in my table. Thank you very much again!
    Last edited by ivanina2000; 03-26-2021 at 07:41 AM. Reason: EDIT

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,023

    Re: Limiting characters in one column based on text in another

    Maybe you didn't replace the , with ; the separator used in BG?

    You're welcome.



    It would be very nice if you were to just click the Add Reputation button at the foot of any of the posts of members who helped you reach a solution.

    Finally, if that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

  5. #5
    Registered User
    Join Date
    03-25-2021
    Location
    Sofia
    MS-Off Ver
    Microsoft Office 365 for Mac
    Posts
    3

    Re: Limiting characters in one column based on text in another

    Yup, that was it :D

+ 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. Limiting Characters In Cell
    By bambino86 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-02-2021, 12:54 AM
  2. [SOLVED] Limiting characters in text box content control
    By Exceltrouble in forum Word Formatting & General
    Replies: 10
    Last Post: 09-02-2016, 02:35 AM
  3. Limiting characters in my signature ..
    By Fotis1991 in forum The Water Cooler
    Replies: 9
    Last Post: 12-10-2011, 07:40 AM
  4. Limiting Row Autofit based on Certain Column
    By Erenagh in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-20-2011, 11:23 AM
  5. limiting characters in a cell
    By abouassi in forum Excel Programming / VBA / Macros
    Replies: 35
    Last Post: 08-18-2006, 08:20 PM
  6. Limiting Characters In Rows
    By Mdlee in forum Excel General
    Replies: 1
    Last Post: 05-16-2006, 12:00 AM
  7. [SOLVED] counting or limiting characters
    By Glenn in forum Excel General
    Replies: 3
    Last Post: 04-04-2005, 04:58 PM

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