Forum Discussion

tpiet's avatar
tpiet
Copper Contributor
Apr 20, 2020

Using a Cell Reference In Place of a Text String

I'm trying to create a table with a column that answers the question "Is this item seasonally available." I'm using a search formula =IFERROR(IF(SEARCH("*April*",[@Months],1),"Yes"),"No"). But I would prefer that the "*April*" be replaced with a cell reference to a cell that contains the Current month. That way, when it goes from April to May, the search function will return different results.

 
 

 

2 Replies

  • SergeiBaklan's avatar
    SergeiBaklan
    Diamond Contributor

    tpiet 

    As a comment, you don't need to add asterisks using SEARCH. To compare

    =IF(ISNUMBER(SEARCH("April",[@Months])),"Yes","No")
    and
    =IF(COUNTIF([@Months],"*April*"),"Yes","No")

    return the same.

    If month name is in cell A1 that will be like

    =IF(ISNUMBER(SEARCH($A$1,[@Months])),"Yes","No")
    and
    =IF(COUNTIF([@Months],"*" & $A$1 & "*"),"Yes","No")