Change text length to either one of two values based on drop down option selected

David

In addition to the question I posted previously, (Change text length based on drop down option selected), I have another scenario where a Bank's account numbers (BANK C) are either 10 or 15 digits long. The answer to my previous question facilitated changing the text length to a range (between 10 and 15 digits) and changing the text length to exactly 12 digits, by creating a lookup table and defining the min and max values.

I was told that a different approach would be needed to change the text length to either one of two values (meaning either 10 or 15 digits), but nothing I've tried so far has worked.


As shown in the last question:

I am using the following table:

enter image description here

I am using the following formula in my Data Validation:

=AND(LEN(B2)<=VLOOKUP(A2,F:H,3,FALSE),LEN(B2)>=VLOOKUP(A2,F:G,2,FALSE))

VLOOKUP will only return the first line and I need it find multiple so I can test against those.


How can I go about getting this to work, while still allowing the other two ways to work?

Rafał B.

Maybe slightly different approach as shown below. Validation rule formula seems working to me:

 =NOT(ISERROR(MATCH(LEN(C3),OFFSET($G$4:$G$9,,MATCH(B3,$G$3:$I$3,0)-1),0)))

We are just checking if we can find length in specific column in the table. Possible values means all possible lengths. You can also build your table horizontally, but this will require some formula adjustments. If you want, you can either expand Range G4:G9 and G3:I3 or change it to named range, or try referencing to column and header of table - these solutions will make our validation formula flexible (when you add item to list, formula will change automatically). I am pretty sure that it is also possible to simplify that formula. I'm sorry for cutting row numbers in the screenshot.

solution

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

Handle event fired when selected drop down option is selected again

分類Dev

Javascript 3 drop down menus. On change of one drop down menu set default value for other two drop down menus. Need optimization

分類Dev

Drop-down box dependent on the option selected in another drop-down box using jquery

分類Dev

Drop Down Control Issue in IE9,IE10. Selected Option not displayed in drop down box

分類Dev

Show Material UI Select (Drop Down) conditionally based on option chosen

分類Dev

Change the drop down selected value from an angular controller

分類Dev

Find previously selected value of drop down list on change event

分類Dev

Keep drop down option

分類Dev

Display items of two drop down based on each other

分類Dev

Working with more than one text box and drop-down

分類Dev

hta vbscript read text files, split data and populate drop down box, remove blank option

分類Dev

update cell with drop down selected value

分類Dev

Fix width of drop down menu in select option

分類Dev

Keep drop down option on the next page

分類Dev

using the .Change() with dropdownlistFor (want to add the values selected to another div as text)

分類Dev

Python django. How can I enter the text selected by the user with a drop-down element in the name_znat field

分類Dev

How to change the position of a drop down arrow in CSS

分類Dev

Change blank selection in drop down list?

分類Dev

Django Admin change drop-down label

分類Dev

Set two values in one table based on sum of a column in another table

分類Dev

Using two drop downs in .NET to manipulate a third drop down list

分類Dev

show selected Drop down value in same page in angular4

分類Dev

Assigning selected items to drop-down list on update "multiple"

分類Dev

Elasticsearch - Query based on text length

分類Dev

jQuery search script based on selected option

分類Dev

Select option based on values of an input

分類Dev

change input maxvalue depending on the selected option

分類Dev

Change color of selected option in html select input

分類Dev

Is there a way to compare two data frames of a different length, based on matching column values?

Related 関連記事

  1. 1

    Handle event fired when selected drop down option is selected again

  2. 2

    Javascript 3 drop down menus. On change of one drop down menu set default value for other two drop down menus. Need optimization

  3. 3

    Drop-down box dependent on the option selected in another drop-down box using jquery

  4. 4

    Drop Down Control Issue in IE9,IE10. Selected Option not displayed in drop down box

  5. 5

    Show Material UI Select (Drop Down) conditionally based on option chosen

  6. 6

    Change the drop down selected value from an angular controller

  7. 7

    Find previously selected value of drop down list on change event

  8. 8

    Keep drop down option

  9. 9

    Display items of two drop down based on each other

  10. 10

    Working with more than one text box and drop-down

  11. 11

    hta vbscript read text files, split data and populate drop down box, remove blank option

  12. 12

    update cell with drop down selected value

  13. 13

    Fix width of drop down menu in select option

  14. 14

    Keep drop down option on the next page

  15. 15

    using the .Change() with dropdownlistFor (want to add the values selected to another div as text)

  16. 16

    Python django. How can I enter the text selected by the user with a drop-down element in the name_znat field

  17. 17

    How to change the position of a drop down arrow in CSS

  18. 18

    Change blank selection in drop down list?

  19. 19

    Django Admin change drop-down label

  20. 20

    Set two values in one table based on sum of a column in another table

  21. 21

    Using two drop downs in .NET to manipulate a third drop down list

  22. 22

    show selected Drop down value in same page in angular4

  23. 23

    Assigning selected items to drop-down list on update "multiple"

  24. 24

    Elasticsearch - Query based on text length

  25. 25

    jQuery search script based on selected option

  26. 26

    Select option based on values of an input

  27. 27

    change input maxvalue depending on the selected option

  28. 28

    Change color of selected option in html select input

  29. 29

    Is there a way to compare two data frames of a different length, based on matching column values?

ホットタグ

アーカイブ