Search code examples
google-sheetsgoogle-sheets-formulagoogle-sheets-apispreadsheet

How do I insert data into sections with dividers in Google Sheets


I have a sheet which is importing data from another sheet using importrange. I've formatted the sheet so that between different "sections", there is a solid blue divider. How do I place data into those sections and "expand" the sections (by adding another row above the divider).

What I would like it to look like

What I want the imported data to be formatted like

But say if I add another element in the originial sheet and import the data, this is what it would look like:

enter image description here

However, I want it to instead move the blue line down instead of putting the data on the blue line so that it looks like this:

enter image description here

The divider row will always be fully blank.


Solution

  • Assuming your data is in column A and B you would just use conditional formatting to make the blank line blue. Something like this could be done:

    Format -> Conditional Formatting
    
    Apply to Range: A1:B
    
    Custom Formula: =($A1&$B1)=""
    
    Apply the color blue
    

    If you share more code to make this problem more specific I can modify my answer accordingly.