Forum Discussion

teddi131's avatar
teddi131
Copper Contributor
Sep 22, 2022

Conditional Formatting - positional

Is it possible to create a conditional formatting rule that applies a format based on the position of the cell? For example - I'd like to apply a format to a cell if the cell is in the first row or the last row of the content. 

4 Replies

  • Yes it is possible. Can you give us some data sample? Because the content means a range, but would be great if you can assist with more details.
    • teddi131's avatar
      teddi131
      Copper Contributor

      Juliano-Petrukio 

       

      Sure, thank you for your help!

       

      So imagine I have 2 different sheets with different sizes of data like -

       

      This one has 4 columns and 11 rows. I ultimately want a border around the whole thing.

      usernamelocationagefavorite color
      mb123LA5purple
      loz2023CA6red
      link45NY7pink
      batmanNM15orange
      daisyFL20blue
      mb1234LA25red
      loz20234CA26yellow
      link454NY27green
      batman43NM25purple
      daisy56FL30blue

       

      This one has 3 columns and 6 rows and I want a border around it as well.

      usernamelocationage
      mb123LA5
      loz2023CA6
      link45NY7
      batmanNM15
      daisyFL20

       

       

      This is a very simplistic example of what I'm trying to do. Ultimately I won't know what the data looks like since it's coming from others, but I want to create conditional formatting that will style it with a border around the table correctly no matter the size of the table (# rows/ # columns). I am writing code to do this and I will know the range of data. I can do this cell by cell, but was hoping to be able to do it with 1 formula that would apply to all cells.

Resources