Forum Discussion

daisyblazey's avatar
daisyblazey
Copper Contributor
Jul 06, 2022
Solved

Reference to Sheet - Returning Blank if Cell is Blank #VALUE! Error

I'm trying to reference text cells from Sheet1 and insert blanks for blank references (as opposed to zeros). When using isblank() or len()=0, I receive #VALUE! errors for the longer text cells. 

 

Sheet1 (sheet to be referenced):

 

Regular Reference (with zeroes I would like to replace with blanks):

 

 

Attempt #1 (len()=0 formula):

 

 

 

 

Attempt #2 (isblank()=true):

 

 

Does anyone have any ideas on formulas I can use to reference blanks as blanks (not zeroes) without getting errors on my longer text references? Thank you!

  • daisyblazey 

    You could use:

     

     

    =MAP(Sheet1!A1:A68,LAMBDA(x,IF(x=0,"",x)))

     

     

     

    The FILTER function can remove 0s but it would also contract the array.  MAP will keep the numbers and blank out the 0s. 

     

    Another solution would be to custom format out the 0s.  For example, custom formatting code: 

    0;-0;;General

     

     

6 Replies

  • Patrick2788's avatar
    Patrick2788
    Silver Contributor

    daisyblazey 

    You could use:

     

     

    =MAP(Sheet1!A1:A68,LAMBDA(x,IF(x=0,"",x)))

     

     

     

    The FILTER function can remove 0s but it would also contract the array.  MAP will keep the numbers and blank out the 0s. 

     

    Another solution would be to custom format out the 0s.  For example, custom formatting code: 

    0;-0;;General

     

     

    • daisyblazey's avatar
      daisyblazey
      Copper Contributor
      The MAP formula worked as it preserved the number type for cells with different types! Thank you so much!
    • PeterBartholomew1's avatar
      PeterBartholomew1
      Silver Contributor
      Neat use of MAP! Not that I had realised that the original formula would fail. ISTEXT also works inside the Lambda function.
  • mtarler's avatar
    mtarler
    Silver Contributor
    yes this is a limitation and there are some workarounds I believe members here came up with BUT in your case I would recommend just using a custom number format on the column to display 0 value as blank (""). Open number format goto 'more number formats', select "Custom" and then under the "Type:" entry bar type: 0;-0;

Resources