Im trying to do an excel chart where the data will vary depending on the results, I'm been reading many articules online for this topic, however, I didnt manage to accomplish it on my data so far.
Here is my problem:
I have 3 lines which I need to update each one based on daily results (game results): so far, there are some games concluded and other that didnt even start yet, therefore, I only want to include on my graph, those games which already happened:
Therefore, I have one cell on sheet that gives the line of the last game available L34, so, I just want include the first game until the last one:
My last game updated is on line 37 and my formulas to y axis text and data are:
I have a formula ="COMPARAÇÃO!"&S39&":"&T39 on cell V39 which means COMPARAÇÃO!E7:F37 for the y axis text and the formula ="COMPARAÇÃO!"&S40&":"&T40 on cell V40 which means COMPARAÇÃO!G7:G37 for the data
I created two cells name (tag): one for the y axis text_range where I used the formula =INDIRECT(COMPA!$V$39)and another one for the line data data_range with the following data =INDIRECT(COMPA!$V$40)
So finally I tried to change the graph series data as following (BOLAO is the name of the excel file and COMPA is the excel sheet with all the data):
However, I get the following error: (It was found a problem with one or more references of formula in the file)
I dont know what can be wrong with my file
try doing =COUNTA(data_range) and =COUNTA(text_range) in a cell and see if those formulas return the expected value or the error you showed above. – John F Jun 25 at 2:40
Related
Let's say we have time slots documented in which a production line was running. In between each product maufactured are time slots in which the machine was idling.
I now want to plot the machine status over time, basically as a boolean value (running vs idling).
I get the machine log and need the chart on the right.
The machining duration will ultimately be logged including seconds and may vary for each product.
The first - and probably biggest - challenge for me is to find a smart way to extract the status from the time stamps. My current first step ist to create a table row for each minute and use the if statement in H4 to check wether article 1 was being manufactured.
IF(AND([#Time]>Machine_log[#Start],[#Time]<Machine_log[#Finish]);;)
However, since the final list will range over 24 hours or more and the number of articles quickly reaches 50 and more, I would love to avoid using nested IFs on this one..
I'm thankfull for any input and open for inspiration :)
Thank you all in advance!
PS: Anyone know how a better way than a scatter chart with two values per X-Value to display the chart as vertical lines/right angles like this?
One option is to add only those points that are necessary to the Status extraction table (which I named "Status"). (I named the Machine log table "Log").
Note: it looks like you are using a semicolon list separator, so you'll need to change the commas in the formulas below to semicolons.
Formula for the Time column:
=IF(ROW()=ROW(Status),MIN(Log[Start])-1/144,IFERROR(INDEX(Log[[Start]:[Finish]],INT((ROW()-ROW(Status)-1)/4)+1,MOD(INT((ROW()-ROW(Status)-1)/2),2)+1),MAX(Log[Finish])+1/144))
Formula for the Production running? column (enter into H4 and fill down):
=IF(SUMPRODUCT(--(Log[[Start]:[Finish]]=[#Time])),IF([#Time]=G3,3-H3,H3),1)
These formulas will pad your plot with 10 minutes of off time on either side.
To answer your question about avoiding two points for each x-value: no, each point on the plot has to have a corresponding data pair.
UPDATE IN RESPONSE TO COMMENT: I failed to mention that the above solution assumes the time data in the Machine log table are in ascending order. This means that if your data span more than one day, they will need to contain a date component or you can get plots where the line crosses back to the beginning. For example, if you have 23:57:00 followed by 00:10:00 with no date component, Excel treats these as 11:57 pm on 1 January 1900 and 12:10 am on 1 January 1900. (To see this, change the format to "General", and you'll see the values that Excel uses to encode date-time aren't in ascending order.) The solution is to enter the dates as "8/16/2020 23:57:00" and "8/17/2020 00:10:00" in the formula bar. If you're copying over from another data source, the date needs to be copied with the time. If the dates and times are in separate columns, your Start and Finish columns would each be a date column plus a time column.
My chart's range data ("A1:E6") looks is in the screen-shot below:
And this is my current Projects Timeline chart (Type Stacked-Bar):
As you can see, my Series Data Labels are in the same format as my Range, which is days.
Question: is there a way (without VBA) to format the Data Labels to be in months ?
For instance, for Project 3, Stage 1 (brown bar), instead of 90, it will display 3.
Is there a way to "out-smart" the screen below:
You can use helper columns in your data to calculate the desired value you want to show in the labels, i.e. divide by 30 to arrive at the approximate month value for any given number of days.
Then, depending on your Excel version and/or preference and/or need for backwards compatibility, you can either
manually edit each data label, hit F2 to edit the data label, type a = sign and then click the cell that has the calculated month value. Repeat for each data label, or
if that sounds too tedious, download and install the free XY Chart Labeler tool by Rob Bovey, which automates the steps above. You can share the file with people who don't have the tool, since all label references will end up hard-coded. The tool just helps reduce the manual labour to link labels to the cells. Or
with Excel 2013 or higher, use the formatting option in the Data Labels side panel to use "Values from cells" and select the cells where the converted values are. This feature is not backwards compatible and will show placeholder text instead of the labels if the file is opened in Excel versions earlier than XL 2013.
Edit: By the way, the formatting section that you highlighted in your screenshot is for formatting the numbers that the label shows. A format can only change the display of a value, but not perform a calculation, like convert number of days into number of months. So, the format approach is a dead end from the get-go.
I've got a spreadsheet with a few thousand tweets in it, each one is time-stamped like so:
18/05/2014 21:14
Amongst other functions I've sorted out, I'd like to plot all the tweets on a graph grouped together by say 15-minute segments.
How can I group those different times(tweets) together?
I found a solution to this on another forum:
http://www.mrexcel.com/forum/excel-questions/359025-pivot-table-grouping-5-min-intervals.html
See the final answer.
It suggests adding a column to your raw data that contains a formula to round each time down to the previous increment.
For you, the formula would be as follows, where A1 contains the time stamp.
=TIME(HOUR(A1),FLOOR(MINUTE(A1),15),0)
In your example, 21:14 would become 21:00. 21:16, meanwhile, would become 21:15.
If you format your data as a table, the formula will auto-fill for all of the tweets.
Then, you can use a pivot chart based on the new column to create your graph. Since everything will be rounded down, the label 21:00 would include all tweets posted from 21:00 to 21:15.
I am trying to plot some time series data, but in a way that has stumped me so far. The salient part here is that each data point is associated with an open date and a closed date. I would like a time series line graph that counts the number open on a given date.
Example: Open - Close
first record: 2/10/2013 - 3/1/2013
second record: 2/15/2013 - 3/5/2013
The graph I'm looking for would start at 0, rise to 1 on 2/10 rise again to 2 on 2/15 then drop down 1 on 3/1 and back to 0 on 3/5.
The actual dataset contains hundreds of records, so manual processing is out of the question. I'm sure there must be an easy way to do it, but I have not found it yet. Tried help and google search, but I'm not exactly sure what I'm looking for.
Use the CountIfs() function like so:
So, you specify the category labels, and then use the COUNTIFS() function to evaluate, for each category label, how many records are open at that time.
You can use the result of the Countifs function as the frequency for a histogram, time series, bar chart, etc.
Then, plot the data in columns E & F (or however your sheet happens to be arranged) to create the chart.
Edit
To include blank values in the count, modify the formula thusly:
=COUNTIFS($B$3:$B$7,"<="&E3,$C$3:$C$7,">="&E3)+COUNTIFS($B$3:$B$7,"<="&E3,$C$3:$C$7,"")
I made a table with my earnings and cash disbursements. And I list the account balance.
Now I want to draw the account balance in a line chart. But the problem is that there isn't a value on every day. So the line between to entries is different because different time lies between two entries. Sometimes three days, sometimes 22 days, ...
How can I realize, that the line is constant after a value and the line only change on a day, with a new value?
Edit (from comment): I'm using Excel 2007
Like the others have said, to get the true time difference between your points to show up, you have to use a scatter plot instead of the Excel line graph.
To display the true state of your balance at in-between dates (i.e., no sloping lines), you'll need to do some transformation of your data. It amounts to creating two new columns of data with duplicate points for each balance: one at the date the account balance reached that level, and one at the date the balance left that level.
I suggest the following:
To populate your Balance column, in the first cell (I'm starting my table at E2) enter
=B2
where B2 is the address of the first balance in your original table. In the next cell down enter
=IF(E2<>E1,E2,OFFSET(B$2,COUNT(E$2:E2)/2,0))
Fill down this formula as far as you need to.
Then in the first cell of the Date column of your new table (I'm starting at D2) enter
=A2
where A2 is the first date in your original table. In the next cell down enter
=IF(E3=E2,OFFSET(A$2,COUNT(E$2:E3)/2,0),D2)
Fill down this formula. Then use this new table as your source data for the scatter plot. Here's a screen capture of a sample:
Are you using an XY-Scatter Plot. A line chart adds in the missing days automatically. Make sure your x-axis is formatted as date.
If you insist on using XY-Scatter Plot then you can put in days for each day, if that day doesn't have data then for the y-axis put in =NA().
I think the chart you need is a step line chart based on your description. The answer of #Excelll above has already pointed out a way to do this in Excel. But here I've another solution that could avoid manually adding some rows to your data. You could use the Funfun Excel add-in to create step line chart. Here is an example that I draw.
As you could see there is some code in the Excel. The Funfun Excel add-in allows you to use JavaScript code directly in Excel so that you could use powerful libraries like HighCharts.js or D3.js to draw charts that could be difficult in Excel alone. In this example, I used HighCharts.js. And it's quite easy to plot this chart since HighCharts.js iteself supports step line chart, so all you need to do is add the step option in your code like the code below.
series: [{
name: "Balance",
data: balance,
step: true,
showInLegend: false
}]
Another advantage of the chart that I showed you comparing to other solution is that you get real time interval in your x-axis. As you mentioned, you may not take record of your balance everyday, the x-axis in the example above shows irregular time interval.
The Funfun also has an online editor in which you could explore your JavaScript code and result. You could check the detail of how I made the example chart in the link below.
https://www.funfun.io/1/#/edit/5a4e478f1010eb73fe125cb2
Once you are satisfied with the result you achieved in the online editor, you could easily load the result into your Excel using the URL above. But of course, first you need to add the Funfun add-in into your Excel by Insert - Office Add-ins. Here are some screenshots showing how you load the example into you Excel.
Disclosure: I'm a developer of Funfun
Excel is really rubbish at charting this kind of thing. In my experience, the best way to chart it is to start with an X-Y plot rather than a line graph, and select the option where it joins the points with a line.
You may also need to add a new column showing "days since start", and use that as the X axis instead of the date - I can't remember whether Excel 2007 can deal with dates properly or not. Try it and see.
Finally, if you include any cells in your chart that are not yet populated (eg because you want to make the chart from the whole column even though you only have a few entries so far), you need to have the empty cells populated with "#N/A" otherwise it will plot them as 0.