How can i change the legend of a chart based on the value of a cell?
Thanks
Varun
How can i change the legend of a chart based on the value of a cell?
Thanks
Varun
Hi Varun,
the legend takes its text from the cell where the category description is stored. So you can change the category description in the data by using a formula that evaluates another cell and changes the category description accordingly, eg.
=IF(A1=99,"This is the changed text","This is the default text")
This is a simple true or false check. If you need something more complex, please post a sample workbook so we can have a better look.
cheers
Hi Teylyn,
Thanks for the reply. Actually i want the legend to be copied from a cell which is being calculated and i don't know what it's value is.
Thanks
Varun
Hi Varun,
the principle is the same. You have a set of data somewhere, with the numbers that you want to graph. Include cells for the data categories in the graph, and they will show as the legend. Manipulate the cells that hold these category names to show what you want in the legend. If they take their value from a calculation that sits in another cell, just reference to this cell. say you have
and in cell X1 you have a calculation that comes up with a value like "mixed fruit". If you want to replace "pears" with whatever is calculated in X1, put![]()
Please Login or Register to view this content.
=X1
in cell A3
Highlight A1 to B3, graph it, and whatever now shows up in A3 will be in the legend.
Hi Teylyn,
The legends which i need are:
1. Time = 1 seconds
2. Time = 4 seconds
Here "1" and "4" are being calculated and stored in a cell. How do i do this?
-Varun
You just need to build the required legend text with formula.
="Time = " & F1 & " seconds"
See attached where the legend uses the values from F1 and F2
or you could have the number in the cell and use the custom number format
0 "second(s)"
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks