[Excel] The data validity of a column is dynamically changed according to the data validity of another column

The basic functional requirements are as follows: Both the primary classification and the secondary classification of vulnerabilities in Figure 1 need to be selected from the sheet in Figure 2. If "Type 1" is selected for the primary classification of vulnerability A, then the secondary classification corresponds to "high risk, medium risk, and low risk"; if "Type 2" is selected, the secondary classification is "basic structure, application system", and so on, the secondary classification is selected according to the selection of the primary classification.

Vulnerability name Classification Secondary classification
Vulnerability A Class II basic structure
Vulnerability B Three categories SQL injection
Vulnerability C one type high risk
Vulnerability D    

Figure 1 sheet-General Vulnerability Classification Table

one type Class II Three categories
high risk basic structure SQL injection
Medium risk operating system cross site scripting
low risk

Figure 2 sheet- classification summary table


Specific implementation steps:

1) First name the first row of the "Summary of Classification" sheet, and the "first-level classification" I took can be modified by yourself. Then name the categories 1, 2, and 3 respectively, which are "secondary classification of the first category", "secondary classification of the second category", and "secondary classification of the third category". The naming method of excel is to select the new line or the column, and then write the name at the position of the red box in Figure 3, or use ctrl+f3 to name.


Figure 3 excel naming method

2) Select column B of the "Vulnerability Classification Summary Table" sheet, select [Data] → [Data Tools] → [Data Validity] → [Settings] → [Sequence], and then enter the formula: "=First Classification" (only write the formula in the outermost quotation marks, the same below)

3) Select C2, [Data] → [Data Tools] → [Data Validation] → [Settings] → [Sequence], and then enter the formula: "=IF(B2="Class I", the second class of Class I, IF(B2="Class II", the second class of Class II, IF(B2="Class III", the second class of Class III)))"

4) Select C2, ctrl+c, select column C (except C1), and then [Paste Special] → [Validity Verification] to realize the same data validity selection function for the entire column C (except C1).

Through the above steps, the function described at the beginning of the article can be realized.

Because the name is the entire row or column, the data validity in column C of the "General Vulnerability Classification Table" also includes the content of the first row in the "General Classification Table". If anyone has a solution, please guide... Thanks in advance.

Guess you like

Origin blog.csdn.net/shuizhongmose/article/details/10958971