Can I populate 1 column in a table with data from a different table?
Asked by Lisa Hooper:

I have a RAG status table with data that looks like Table 1 below. I have another table in a tab on the same page that looks Table 2 below. Can I have the January column in Table 1 be populated by the values in the Status column in Table 2?

![Screenshot 2022-02-02 145834.png](/t5/image/serverpage/image-id/181263i1A0F74C96366571D/image-size/large?v=v2&px=999 "Screenshot 2022-02-02 145834.png")

Last question is can I have the value of G color the cells with a green background automatically?

![Table2.png](/t5/image/serverpage/image-id/181266i97C9985C8657CC5E/image-size/large?v=v2&px=999 "Table2.png")

Thanks for any help!


Answers:
author: Katerina Kovriga {Stiltsoft}
body: Hi there,

As this thread mentions our [Table Filter and Charts for Confluence](https://marketplace.atlassian.com/apps/27447/table-filter-and-charts-for-confluence?tab=overview&hosting=cloud&utm_source=atl_community) app, we are happy to introduce its new macro -- [Table Spreadsheet](https://docs.stiltsoft.com/display/public/TFAC/How+to+use+Table+Spreadsheet+macro?utm_source=atl_community).

The macro allows you to work with fully functional Excel spreadsheets right in Confluence.

You'll be able to use cells' formulas, filters, conditional formatting, etc., create pivot tables and charts from the page view and edit modes.

The Table Spreadsheet macro is available for Cloud and Server/Data Center.

![](https://docs.stiltsoft.com/download/attachments/83100938/Conditional%20formatting.png?version=1&modificationDate=1641987630000&api=v2&effects=border-simple,shadow-kn)


author: Katerina Kovriga {Stiltsoft}
body: Hi [@Lisa Hooper](/t5/user/viewprofilepage/user-id/3072060) ,

We can suggest trying our [Table Filter and Charts for Confluence](https://marketplace.atlassian.com/apps/27447/table-filter-and-charts-for-confluence?tab=overview&hosting=cloud&utm_source=atl_community) app.

At first you may reuse these tables using the [Table Excerpt/Table Excerpt Include](https://docs.stiltsoft.com/display/public/TFAC/How+to+use+Table+Excerpt+and+Table+Excerpt+Include+macros?utm_source=atl_community) macros (especially the second one - it is very convenient if your source tables are placed on different pages). For simplicity, I've placed them on the same page - the first step is to wrap your tables (reused or not) into the [Table Toolbox](https://docs.stiltsoft.com/display/public/TFAC/How+to+use+Table+Toolbox+macro?utm_source=atl_community) macro:

![Thu 10-1.png](https://community.atlassian.com/t5/image/serverpage/image-id/181345iD2B25C7F4912CA36/image-size/large?v=v2&px=999 "Thu 10-1.png")

The second step is to wrap your tables into the [Table Transformer](https://docs.stiltsoft.com/display/public/TFAC/How+to+use+Table+Transformer+macro?utm_source=atl_community) macro inside the Table Toolbox macro and use the following customized SQL query:

![Thu 10-2.png](https://community.atlassian.com/t5/image/serverpage/image-id/181346iAE815566F2DBC1AE/image-size/large?v=v2&px=999 "Thu 10-2.png")

SELECT \*,  
FORMATWIKI("{cell:bgColor=" +  
CASE WHEN T2.'Jan, 2022' LIKE "G" THEN "#abf5d1"  
WHEN T2.'Jan, 2022' LIKE "Y" THEN "#fff0b3"  
ELSE "#ffbdad"  
END  
+ "}" + T2.'Jan, 2022' + "{cell}")  
AS 'Jan, 2022'  
FROM T1 OUTER JOIN T\* ON T1.'Metric' = T\*.'Metric'

This query allows us to [look up](https://docs.stiltsoft.com/display/public/TFAC/Default+automatic+presets#Defaultautomaticpresets-Lookuptablespreset?utm_source=atl_community) tables by the unique "Metric" column and [color the cells' background](https://docs.stiltsoft.com/display/public/TFAC/Advanced+table+cells+formatting#Advancedtablecellsformatting-Conditionalformatting?utm_source=atl_community) based on the status for the "Jan, 2022" column.

As a result, we'll see the following table:

![Thu 10-3.png](https://community.atlassian.com/t5/image/serverpage/image-id/181347i36A9CD2DAE5789C2/image-size/large?v=v2&px=999 "Thu 10-3.png")

Then we wrap the Table Transformer macro into the [Table Filter](https://docs.stiltsoft.com/display/public/TFAC/How+to+use+Table+Filter+macro?utm_source=atl_community) macro, hide the unwanted columns and filter the combined result table, for example, by statuses:

![Thu 10-4.png](https://community.atlassian.com/t5/image/serverpage/image-id/181349i5B88C85BE5AED957/image-size/large?v=v2&px=999 "Thu 10-4.png")

![Thu 10-5.png](https://community.atlassian.com/t5/image/serverpage/image-id/181350iDE5FCE81F74FD919/image-size/large?v=v2&px=999 "Thu 10-5.png")

Hope this helps your case.

comments: author: Lisa Hooper
body: The answer looks pretty clean. However, we don't have that macro and I don't think we'll be allowed to purchase another macro.

Are they others that have done all or parts of this without additional macro support?


author: Katerina Kovriga {Stiltsoft}
body: With the standard set of macros you'll be able to reuse your tables and place them on the master page (check the Excerpt/Excerpt Include macros).

The conditional formatting is also not possible out-of-the-box.


Tags: cloud

confluence-cloud