A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
As Rajesh says, you need VBA to hide rows automatically.
As I understand, you want to hide rows 2 to 6 when cell A1 is empty and show rows 2 to 6 when A1 has a value. You could do this with the following code. Copy the code, then right click the sheet tab, select "View Code" and paste the code into the code window.
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("1:1")) Is Nothing Then
If Len(Range("A1")) = 0 Then
Rows("2:6").EntireRow.Hidden = True
Else
Rows("2:6").EntireRow.Hidden = False
End If
End If
End Sub
This assumes that the values in cells X1 and Y1 are entered manually.