简体   繁体   中英

Data validation excel offset of current cell for two columns SNR and REG

I am trying to with data validation in excel to get two columns in one column so to speak. In the column I have circled blue I want to have the user pick Reg or SNR (circled red) and it will get the offset of the current cell. I have tried [![=OFFSET(INDIRECT(ADDRESS(ROW(), COLUMN())),0,5)][1]][1] which works as the cell is always 5 to right. However it does not get the values under that but only that one cell. It also of course excludes Reg values. Is what I am after possible in Excel or do I have to do up a new table to incorporate SNR?

在此处输入图片说明

create a named range for SNR and REG and use the below as the formula in the data validation rule:

=INDIRECT($O$5)

在此处输入图片说明

You can make the named range for REG dynamic like using the below:

=OFFSET($U$6,0,0,COUNTIF($U$6:$U$6000,">"&0),1)

And simply change the range and do the same for SNR 在此处输入图片说明

If I understand you correctly, this is what you are trying to do but let me know if this is not what you intended to do.

First, under cell O5 , I set up a Data Validation like the pic above so the end user can pick either SNR or Reg .

Second, I used this OFFSET formula inside Data Validation to display the possible values under either column T or U based on the selection on cell O5 :

=IF(O5="SNR",OFFSET($T$6,0,0,COUNTIF($T$6:$T$6000,">"&0),1),OFFSET($U$6,0,0,COUNTIF($U$6:$U$6000,">"&0),1))

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