A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data
Hi Megan,
I hope you're doing well today.
To confirm, you are using a COUNTA formula to check for data in the range D2277 through T2277, and it is returning "Data" even when those cells appear empty. I understand how this can be confusing, especially since the formula was already designed to show nothing when no data is present.
This happens because the COUNTA function counts any cell that contains a formula as a cell with content, even when that formula returns an empty text value. Since the cells in your range D2277:T2277 already contain formulas built to show nothing when there is no data, COUNTA still detects those formulas as present, which is why "Data" appears regardless of whether the source cells hold numbers or dates.
To fix this, you can update your formula so it checks the actual displayed value of each cell instead of checking whether a formula exists there. Please follow the steps below:
Option 1: SUMPRODUCT with a not-equal-to-empty-string check:
- Open the cell that contains your current formula.
- Replace it with the following formula:
=IF(SUMPRODUCT(--(D2277:T2277<>""))>0, "Data", "")
- Or
=IF(SUMPRODUCT(--(D2277:T2277)<>0))>0, "Data", "")
This works because Excel treats a formula's "" result as actually equal to "" when doing a comparison (unlike COUNTA, which only checks "does this cell have content"). So cells that evaluate to empty get excluded, while real numbers and dates still count.
- Copy the formula down or across to the remaining rows or columns where the same check is needed.
- Test the result by clearing a few referenced cells to confirm the column now shows nothing when no data is present.
Option 2: Flip the logic with COUNTBLANK:
=IF(COUNTBLANK(D2277:T2277)<COLUMNS(D2277:T2277), "Data", "")
COUNTBLANK treats formula-produced "" results as blank (the opposite quirk from COUNTA), so this compares the blank count to the total number of columns in the range; if not all of them are blank, there's real data.
Either one will correctly ignore cells that are formulas returning nothing while still catching actual numbers and dates. I'd go with Option 1 since it's a bit more explicit about what it's checking, but both should behave identically in your case.
I hope this information helps point you in the right direction. Please let me know if you have any questions or if you would like help adjusting this for additional columns. I’d be happy to assist.
Thank you for your understanding, and have a wonderful day ahead.
If the answer is helpful, please click "Yes". If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in the forum documentation to enable e-mail notifications if you want to receive the related email notification for this thread.