简体   繁体   中英

How to apply restriction on a column value based on another column value in Excel

I have come across a requirement where I need to apply restriction on column C based on values in column A

Suppose,

Column A value = "DSOC", Then I don't want any value in column C.So if user tries to make an entry in Column C it should throw an error showing that Column C entry not allowed for "DSOC"

Column C entry should be done only if Column A value is = "DSOF".

You can use Excel's Data Validation feature to achieve this. Select the entire column and then implement following formula.

=ISNA(VLOOKUP(B1,A:A,1,0))

Refer below snapshot.

数据验证

I was able to complete the requirement in the following way.I just found the address of the cell which I tried to edit by using the below formula in the screensot在此处输入图像描述

If the value is DSOF then I am displaying an error message

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM