Google Search

Custom Search
Showing posts with label TEXT FUNCTION. Show all posts
Showing posts with label TEXT FUNCTION. Show all posts

Create year , quarter , month, Week, day, hour

 We often need to do summary reports based on week, month, quarter, year and so on. 

Let's see how to extract these info from time stamp.


For example lets consider 1/1/2021  4:00:00 AM





Hour

=TEXT(A2,"hh")



Day

=TEXT(A2,"dd")


=TEXT(A2,"ddd")



=TEXT(A2,"dddd")




Week

=WEEKNUM(A2)




Month

=TEXT(A2,"mm")


=TEXT(A2,"mmm")



=TEXT(A2,"mmmm")



Quarter

To calculate quarter we will use month info.

=ROUNDUP((MONTH(A2))/3,0)

Some companies use different starting month for quarter need to adjust the month.



Year

=TEXT(A2,"yyyy")










How to use formulas with Chart titles

This is a very simple trick but seems many not aware of it. Let say we need a chart for daily production out put and the data is updated every day.


Lets add (insert) a bar chart.
Select the data



Insert chart


The chart looks like,


Now need to add some titles for horizontal and vertical axis. 

Select "DESIGN" from menu → select "Add Chart Element" → select "Axis Titles" → select "Primary Horizontal"

Do the above for "Primary Vertical" also.



The chart will look like,


Now change the "Axis Title". 
Click on the Horizontal "Axis Title" and in the "Formula Bar" type =Sheet1!$B$5. 
For vertical axis title type =Sheet1!$C$5.

Now the chart looks like,


Now, Chart title need to be changed to "Output report for 25 January 2014" and if the data changed to another date the chart title to be changed accordingly.  This is where we need a bit more complicated formula. 

In a cell (E1) key in the following formula

=CONCATENATE("Output Report for ",(CONCATENATE(DAY($C$3)," ",TEXT($C$3,"mmmm")," ",YEAR($C$3))))

(CONCATENATE(DAY($C$3)," ",TEXT($C$3,"mmmm")," ",YEAR($C$3)))) = 25 January 2014

Please pay attention to the month "TEXT($C$3,"mmmm")" formula. 

Then click on the chat title and key in =Sheet1!$E$1 in the formula bar.




Now the chart will look like,



Now if the data changed to 1 March 2014, the chart will be changed automatically,



Please leave your comments, thanks.

 

blogger templates | Make Money Online

Google Analytics Alternative ExpiresDefault access plus 1 year