IF FUNCTION TO HIDE A ROW

%3CLINGO-SUB%20id%3D%22lingo-sub-2308503%22%20slang%3D%22en-US%22%3EIF%20FUNCTION%20TO%20HIDE%20A%20ROW%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2308503%22%20slang%3D%22en-US%22%3E%3CP%3EI'm%20very%20new%20at%20this.%20I%20am%20trying%20to%20hide%20a%20row%20on%20a%20sheet%20when%20there's%20no%20data%20in%20it.%20I%20have%2010%20sections%20of%20rows%2C%20each%20section%20containing%206%20rows.%20Sometimes%20I%20might%20have%20data%20in%204%20of%20them%20and%20I%20would%20like%20to%20hide%20the%202%20without%20any%20data.%20I%20can't%20just%20delete%20them%20because%20of%20the%20formulas%20in%20the%20columns%20for%20when%20I%20do%20have%20data.%3C%2FP%3E%3CP%3EI'm%20using%20the%20IF%20function%2C%20because%20when%20I%20do%20have%20data%2C%20it%20becomes%20part%20of%20the%20formula%20for%20one%20of%20the%20columns.%3C%2FP%3E%3CP%3E%3DIF(A8%3DA9%2C(D9-D8)%2C%200)%3C%2FP%3E%3CP%3EBasically%2C%20I%20need%20that%20last%20zero%20to%20be%20a%20command%20to%20hide%20the%20column.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2308503%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2308538%22%20slang%3D%22en-US%22%3ERe%3A%20IF%20FUNCTION%20TO%20HIDE%20A%20ROW%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2308538%22%20slang%3D%22en-US%22%3ESorry%2C%20last%20phrase%20correction%2C%20to%20hide%20the%20row.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2308558%22%20slang%3D%22en-US%22%3ERe%3A%20IF%20FUNCTION%20TO%20HIDE%20A%20ROW%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2308558%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1041177%22%20target%3D%22_blank%22%3E%40eschalm%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFormulas%20return%20only%20values%20to%20the%20cells%20and%20nothing%20else%2C%20you%20can't%20change%20properties%20of%20the%20cell%20or%20perform%20any%20command%20with%20formula.%20That's%20VBA%20programming.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBut%20perhaps%20it's%20easier%20to%20apply%20the%20filter%20and%20hide%20all%20rows%20with%20zero%20by%20it.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2310608%22%20slang%3D%22en-US%22%3ERe%3A%20IF%20FUNCTION%20TO%20HIDE%20A%20ROW%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2310608%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F521%22%20target%3D%22_blank%22%3E%40Sergei%20Baklan%3C%2FA%3E%26nbsp%3BThank%20you%20for%20the%20clarification.%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

I'm very new at this. I am trying to hide a row on a sheet when there's no data in it. I have 10 sections of rows, each section containing 6 rows. Sometimes I might have data in 4 of them and I would like to hide the 2 without any data. I can't just delete them because of the formulas in the columns for when I do have data.

I'm using the IF function, because when I do have data, it becomes part of the formula for one of the columns.

=IF(A8=A9,(D9-D8), 0)

Basically, I need that last zero to be a command to hide the column.

3 Replies
Sorry, last phrase correction, to hide the row.

@eschalm 

Formulas return only values to the cells and nothing else, you can't change properties of the cell or perform any command with formula. That's VBA programming.

 

But perhaps it's easier to apply the filter and hide all rows with zero by it.

@Sergei Baklan Thank you for the clarification.