You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Graphic to always relate to row 1 to 7

I am doing a graph and on a daily basis I am updating the data by adding a row at the top of the worksheet. I would like the graph to always relate to the first 7 rows of the table.


I.e wants to force the graph to always start at row one even when adding new rows. At the moment each time a row is added I do have to manually change data reference.


Is there a way to force the graph to always relate to data starting a Row 1.


Thanks in advance!


Posted on Feb 27, 2023 3:46 PM

Reply
Question marked as Top-ranking reply

Posted on Feb 27, 2023 4:32 PM

I suggest creating a new table that collects the last 7 days automatically.



Then use the new table as the source of information for the chart


Make sure your original table is named "Data". Also... I notice you are in a non-US location. I will present that formulas the way we would use them in the US. if you use the comma as the decimal, then replace commas in the formulas I post with semicolons.




In the new summary table, select A2, then type of copy and paste from here the formula:

=MAX(Data::A)


shorthand for this is:

A2=MAX(Data::A)


A3=$A2−1


select cell A3, copy

select cells A3 thru the end of column A, paste


B2=XLOOKUP($A2,Data::A,Data::B,"",0,search-type)

select cell B2, copy

select cell B2 thru the end of column B, paste


plot column B from the new table. You can even place the table under the chart (if you want to hide it) by selecting the chart, then use the menu item "Arrange > Bring To Front"






4 replies
Question marked as Top-ranking reply

Feb 27, 2023 4:32 PM in response to Zoomdan

I suggest creating a new table that collects the last 7 days automatically.



Then use the new table as the source of information for the chart


Make sure your original table is named "Data". Also... I notice you are in a non-US location. I will present that formulas the way we would use them in the US. if you use the comma as the decimal, then replace commas in the formulas I post with semicolons.




In the new summary table, select A2, then type of copy and paste from here the formula:

=MAX(Data::A)


shorthand for this is:

A2=MAX(Data::A)


A3=$A2−1


select cell A3, copy

select cells A3 thru the end of column A, paste


B2=XLOOKUP($A2,Data::A,Data::B,"",0,search-type)

select cell B2, copy

select cell B2 thru the end of column B, paste


plot column B from the new table. You can even place the table under the chart (if you want to hide it) by selecting the chart, then use the menu item "Arrange > Bring To Front"






Feb 27, 2023 5:23 PM in response to Wayne Contello

Many thanks Wayne. I got it to work with a slight change in cell B formula.


For some reason the "B2=XLOOKUP($A2,Data::A,Data::B,"",0,search-type)" function did not work.


I replaced it with "LOOKUP($A2,Data::A,Data::Data)" and it now works. Is there a problem in using the formula I've inserted?


Now each time I enter a row at the tip of the Data table everything seems to be OK.


Another question:

Is there a way when adding a row in the Data table to have the date being automatically inserted. I.e the next day following Row A3 (27 Feb 2023). Row A2 should then be (28 Feb 2023).


Kind regards!



Graphic to always relate to row 1 to 7

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.