简体   繁体   中英

How to use a named range as an output for IF statement in excel?

I am trying to do a simple IF statement in excel which uses a named range which is a range of countries, ie NOT numbers however I am getting the "#VALUE" in the cell with the warning "A value used in this formula is of the wrong data type"

Formula in Cell: =IF($F$5="All", Countries, F5)

where "Countries" is my named range

Can this be done?

Many thanks in advance!

Welcome to SO. Are you looking for something like that?

=IF(F5="All",TEXTJOIN(", ",,Countries),F5)

Countries range is specified in cells A1:A5 .

在此处输入图片说明

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