Excel column chart with values per date - excel

I have the following in Excel
Date Connections
2013-10-16 6
2013-10-17 18
2013-10-18 16
2013-10-19 10
2013-10-21 9
2013-10-22 1
2013-10-23 33
2013-10-24 38
2013-10-25 15
2013-10-26 20
2013-10-27 12
2013-10-28 9
2013-10-29 7
2013-10-31 2
2013-11-01 4
2013-11-02 1
2013-11-03 1
2013-11-04 2
2013-11-05 6
2013-11-06 15
2013-11-07 11
2013-11-08 13
2013-11-09 16
2013-11-10 9
2013-11-11 20
2013-11-12 2
I am trying to do a column chart that shows connections per date.
Just selecting the cells and clicking chart gives
I can right click the respective axis and format to get this:
But that only shows the calue for the last date, how do I get it to show all data?
I have googled for a while now but it just seems to add to the confusion.

Turns out that this was due to faulty formatting of the date column when importing the data.
Importing the column as text and then converting it to date and everything works as expected.

Related

Excel - Multiplier Effect / Loop

I have a situation that for every 6 contracts I sign I am able to sign an additional 1. That also means that for every additional 6 contracts I can sign another contract. This of course goes on for ever.
Contract Additional Additional(2) Total
6 1 0 7
12 2 0 14
18 3 0 21
24 4 0 28
30 5 0 35
36 6 1 43
...
Is there away of doing generating the total without using VBA?
Thanks
Your "Total" column is related to the "Contract" column by:
Total = INT(Contract+(Contract-6)/5)+1
So the formula to fill down would be =INT(A2+(A2-6)/5)+1 if your "Contract" column is column A.
Put this in the first cell and copy down:
=7*ROW($ZZ1)+INT((ROW($ZZ1))/6)

How to select a set of values in pandas data frame (multiple colums with multiple row conditions)

I have a huge ass csv file like given below which I opened as dataframe using pandas. I want to extract data from multiple columns at different date sets.
I want to select from a particular date and hour to another for the last 3 column values. The slicing options I tried and googled were for single column.
date heure PM10 NO2 O3
0 01/01/2016 1 27 22 36
1 01/01/2016 2 25 29 27
2 01/01/2016 3 26 47 10
3 01/01/2016 4 16 40 13
4 01/01/2016 5 15 34 13
5 02/01/2016 1 15 34 13
6 02/01/2016 2 15 34 13
Target output - taking data from a particular data and hour to another one.
3 01/01/2016 4 16
4 01/01/2016 5 15
Thank you. The data set is obviously way bigger than 4 No.
You can do this:
df_selected = df[(df.date >= "01/01/2016") &
(df['hour']>=4) &
(df.date < "02/01/2016") &
(df['hour']<6)
].iloc[:,:3] #first three columns
Alternatively, for the columns selection you can use .loc[:,['name', 'of', 'columns']] or for the last n columns .iloc[:,-n:].
Be careful with date because I'm not sure what happens with an "English" date, maybe you have to change the date using df['date'] = pd.to_datetime(df.date).

Difference Pivot_table Pandas and excel

When I create a pivot table from data in Pandas (python), I get an other result than when I create it with Excel. I think this is due to the fact of characters. Someone knows the difference between the pivot table in Pandas and Excel?
I've made this example. I have the excel file 'funds_steven' with following data in 1 column. (column name = Steven_Funds)
Steven_Funds
0 100
1 -58
2 89
3 24
4 -89
5 76
6 -4
7 -180
8 767
9 0
10 0
11 56
12 32
13 0
14 0
15 12
How can I read this in and calculate the sum of the values?

Matching multiple criteria (matrix transpose)

In Excel, I want to lookup/index a table that matches both the station_number and the month.
Say I have the following data on sheet1:
Jan Feb Mar Apr May
station1 1 8 17 14 0
station5 4 5 8 10 14
station7 18 7 4 9 10
station10 5 11 15 12 4
On sheet2, I want to fill in the details below:
Station1 Station2 Station3 Station4 Station5 Station6
Jan 1 4
Feb 8 5
Mar 17 8
Apr 14 10
May 0 14
What is the formula I use in order to look up sheet1 and complete sheet2? I tried =VLOOKUP(B1&A2,'Sheet1'!A1:F5,2,FALSE) which is obviously incorrect. Any help would be great.
You should use Hlookup something like following for column station1:
=+HLOOKUP(A2,Sheet1!$A$1:$F$2,2,0)
It should work and hope this helps also.
where sheet1 is the actual source of your input data, but offcourse with every column the references must be change so for station10 column formula would be:
=+HLOOKUP(A2,Sheet1!$A$1:$F$5,5,0)
Please try:
=IFERROR(INDEX(sheet1!$B$2:$F$5,MATCH(J$1,sheet1!$A$2:$A$5,0),MATCH($I2,sheet1!$B$1:$F$1,0)),"")
in sheet2 where your 1 is (assumed to be J2), and copy across and down to suit.

Table transformation in Excel

I have a spreadsheet with data in following format:
CarID Day DistanceTraveled
Ford1 1 10
Ford1 2 12
Nissan1 1 13
Ford1 3 41
Nissan1 2 20
Nissan1 3 10
...
And so on. There are a few hundreds of records in format like this, with a few dozens of cars.
I have to transform it into a following format:
Day Ford1 Nissan1
1 10 13
2 12 20
3 41 10
Is it any fast and automatic way to achieve it in Excel?
Just for the sake of an answer:

Resources