Search

Friday, April 16, 2021

 Trim and Trap for Empty Cells in Excel


This formula is used to check if a cell has a blank value and if it does, it returns "N/A".  However, some data isn't clean and there may be blank spaces in the referring cell (i.e. not clean).  Here we utilize the Trim and If statements together to clean up any accidental spaces so not to get a blank return instead of N/A

Place this formula in a cell that is referencing the same or a difference sheet with any column of data that you want to return a value and if there is truly nothing (thanks to the Trim function) in that cell, return a "N/A".


=IF(TRIM('All deals'!F2)="","N/A",'All deals'!F2)