Search code examples
excelif-statementexcel-formula

Excel formula - IF true, return a text and cell value


I have data across two sheets in Excel and i am trying to put together a formula in Excel that says:

Assume i am in the cell B1 in Sheet 2
IF the character length in Sheet 1, cell A1 is greater than 35 character
if true - return "Text:" + whatever is in the cell A1 in Sheet 1 in full length
if false - do nothing

So far i have tried:

=IF(LEN('Sheet1'!A1)>35;"Text:"+'Sheet1'!A1)

This returns #VALUE! in the cell B1, Sheet 2. The problem is probably in combining the text and the cell value in the if_true result. Looks like a simple formula, but i can't wrap my head around this.

Thanks for any help!


Solution

  • Try below-

    =IF(LEN(Sheet1!A1)>35,"Text:" & Sheet1!A1,"")
    

    Comma (,) and semicolon (;) depend on regional settings.