Forum Discussion

packie's avatar
packie
Brass Contributor
Sep 08, 2024
Solved

Return text value instead of 0

 

Rather than return a 0 is it possible to return a text value instead?

 

=COUNTIFS(Trades!$R$5:$R$1099,D37,Trades!$O$5:$O$1099,">0")

  • packie 

    I see three options:

    =IF (COUNTIFS(---------), COUNTIFS(---------), "text")

     

    Or if you want to avoid the repetition of the entire COUNTIF part and you are using a modern Excel version,

    =LET(

         c, COUNTIFS(---------),

         if(c, c, "text")

    )

     

    Or you could leave the outcome to be zero and use a custom format like General:General;"text"

     

    This will display the "text" although the underlying value is still zero.

     

2 Replies

  • Riny_van_Eekelen's avatar
    Riny_van_Eekelen
    Platinum Contributor

    packie 

    I see three options:

    =IF (COUNTIFS(---------), COUNTIFS(---------), "text")

     

    Or if you want to avoid the repetition of the entire COUNTIF part and you are using a modern Excel version,

    =LET(

         c, COUNTIFS(---------),

         if(c, c, "text")

    )

     

    Or you could leave the outcome to be zero and use a custom format like General:General;"text"

     

    This will display the "text" although the underlying value is still zero.

     

    • packie's avatar
      packie
      Brass Contributor
      I have gone for your second option:

      =LET(

      c, COUNTIFS(---------),

      if(c, c, "text")

      )

      This gave the outcome I think will do.
      Thank you 🙂