Excel Tips Submitted by You [Part 1]

Share

Facebook
Twitter
LinkedIn

This week we are celebrating Your Week @ PHD. That means you get to read the excel tips shared by other readers of this blog.

Unhide all the sheets using simple macro by Kat

My single favourite simple macro ever – to fill in the gap that Excel leaves. Unhiding -all- hidden tabs in a workbook at once. I install it in the personal.xls workbook, and save myself hours of clicking.

Sub Unhide_All_Sheets()
 Dim wsSheet As Worksheet 

 For Each wsSheet In ActiveWorkbook.Worksheets 

 wsSheet.Visible = xlSheetVisible 

 Next wsSheet
End Sub

A KPI Dashboard using VBA and Charts by David

After learning a whole lot over the past few months from this site and others (so many I can’t even remember right now – but I will make a list soon of where I found things), I constructed a KPI spreadsheet (see link below).  This spreadsheet allows our institution to create standardized KPI reports for university consumption.

I attempted to keep the colors muted even though I chose school colors (from the publishing guide) for the actual graph.

Features

The chart is dynamically configured in numerous ways.  The user can control the title (via cell entry on left), color of bars (via color of data labels), number format (via number format of the first data cell), and the display and printing of the trend line.  The KPI name comes from the sheet, and the vertical axis is determined based on the data (I find the maximum value and divide by 4).

To-dos

I would like the user to be able to enter new descriptive items via a form with the option to include variables (KPI_Name, KPI_Category, etc.).  I would like the user to be able to include more than one chart on a page (some KPIs actually need to track parts of the whole).

I am sure there are more features I will think of as time goes on but I wanted to let others see this and hopefully be able to incorporate it into their/your own work.  The file is available here: http://dl.getdropbox.com/u/749941/KPIs_PHD.xlsm.  Hopefully I will be starting a blog soon to talk more about what we are doing here with excel and other products.

Using Find Dialog to Solve a Tricky Problem by Christy Lee

Introduction:

On a project I recently worked, we crunched several hundred (about 400) rows of data. The creator of the original document did not have any way to foresee the life this project would take on! So…there was only one field for ‘Name’ which contained the names of the team members for the corresponding step of the overall project.

Challenge:

As the project progressed, an individual may be added to multiple task teams. So, your name might be one of three in four records, one of ten in fifteen records, etc. Also, the team members could be added on the fly…you see how the complications arise quickly! Oh, and the project was run on three continents in four countries….

Each person was responsible for updating their pertinent information. Because of the complexity of that one name cell, filtering and sorting became cumbersome.

Solution:

Hide all rows except for the header row.

Do a search on your name (fortunately, in about three dozen team members, we had no duplicate last names!)

When the search results dialog comes up, select all of the records (select first, shift+select last)

Go to Format>Row>Show.

Whoo Hoo!  There are all (and ONLY) the records that belong to you.

Array Formulas to the Rescue by Rajinikanth

This is the formula to find out Employees first login time and last logout time for the day.

Example : Suppose employee table is starting form Column B

then the table looks like :
Name Code
1001 rajinikanth
1002 srinivas
1003 vardhan

and the Login Data is starting from Column G in a sheet

Array Formulas - User Session Times

Then The formula for First login :

{=1/MAX((B8=$G$7:$G$15)*($H$7:$H$15<>0)*(1/$H$7:$H$15))}

and the formula for Last Logout :

{=MAX(($G$7:$G$15=B7)*($I$7:$I$15))}

A Big Warm Lovely Heartfelt Thank you to Kat, David, Christy and Rajinikanth. You are truly wonderful.

Be a part of the “your week” @ PHD

Come, be part of the your week celebrations at PHD. Click here to submit your excel tips. Your tips will be shared with all our readers during this week (May 11-15, 2009)

PS: If you have already shared your tips and not seeing them in this post, don’t worry. I am posting only a few everyday, so yours will be in the next 3 posts.

Facebook
Twitter
LinkedIn

Share this tip with your colleagues

Excel and Power BI tips - Chandoo.org Newsletter

Get FREE Excel + Power BI Tips

Simple, fun and useful emails, once per week.

Learn & be awesome.

Welcome to Chandoo.org

Thank you so much for visiting. My aim is to make you awesome in Excel & Power BI. I do this by sharing videos, tips, examples and downloads on this website. There are more than 1,000 pages with all things Excel, Power BI, Dashboards & VBA here. Go ahead and spend few minutes to be AWESOME.

Read my storyFREE Excel tips book

Overall I learned a lot and I thought you did a great job of explaining how to do things. This will definitely elevate my reporting in the future.
Rebekah S
Reporting Analyst
Excel formula list - 100+ examples and howto guide for you

From simple to complex, there is a formula for every occasion. Check out the list now.

Calendars, invoices, trackers and much more. All free, fun and fantastic.

Advanced Pivot Table tricks

Power Query, Data model, DAX, Filters, Slicers, Conditional formats and beautiful charts. It's all here.

Still on fence about Power BI? In this getting started guide, learn what is Power BI, how to get it and how to create your first report from scratch.

13 Responses to “Convert fractional Excel time to hours & minutes [Quick tip]”

  1. Debraj Roy says:

    Hi Purna..

    Again a great tip.. Its a great way to convert Fractional Time..
    By the way.. Excel has two great and rarely used formula..

    =DOLLARFR(7.8,60) and =DOLLARDE(7.48,60)

    basically US Account person uses those to convert some currency denomination.. and we can use it to convert Year(i.e 3.11 Year = 3 year 11 month) and Week(6.5 week = 6 week 5 days), in the same manner...

  2. Jason says:

    This doesn't work for me. When applying the custom format of [h]:mm to 7.8 I get 187:12

    Any ideas why?

    • Hui... says:

      @Jason
      7.8 in Excel talk means 7.8 days
      =7.8*24
      =187.2 Hrs
      =187 Hrs 12 Mins

      If you follow Chandoo's instructions you will see that he divides the 7.8 by 24 to get it to a fraction of a day

      Simple, assuming the fractional time is in cell A1,

      Use below steps to convert it to hours & minutes:

      1. In the target cell, write =A1/24
      2. Select the target cell and press CTRL+1 to format it (you can also right click and select format cells)
      3. Select Custom from “Number” tab and enter the code [h]:mm
      4. Done!

  3. WhoKnows says:

    Hi, sorry to point this out but Column C Header is misspelt 'Hours Palyed'

  4. abhishek malik says:

    good one

  5. Julia says:

    So how do I go the other way and get hours and minutes to fractional time?

    • Chandoo says:

      If you have 7.5 in cell A1,

      - Use int(A1) to get the hours.
      - Use mod(A1,1)*60 to get minutes.

      If you have 7:30 (formatted as time) in A1

      - Use hours(a1) to get hours
      - Use minutes(a1) to get minutes.

      • Paula says:

        I had the same issue. You can solve it by changing the format as described above:

        Right click cell > Format Cells > (In Number tab) > Custom > Then enter the code [h]:mm
        ([hh]:mm and [hhh]:mm are nice too if you want to show leading zeros)

        • Jack Scarce says:

          Thanks guys, these are the tips I'm looking for.
          ...dividing the number of minutes elapsed by the percent change is my task - "int" is the key this time

  6. Srikanth says:

    It doesnt work for greater than 24 hours
    It returns 1:30 for 25.5 hours. It should have returned 25:30

    Ideally I would right function as
    =QUOTIENT(A1,1)&":"&MOD(A1,1)*60

    • Paula says:

      Sorry, replied to wrong comment....

      ----
      I had the same issue. You can solve it by changing the format as described above:

      Right click cell > Format Cells > (In Number tab) > Custom > Then enter the code [h]:mm
      ([hh]:mm and [hhh]:mm are nice too if you want to show leading zeros)

  7. Daniel says:

    Clever use of MOD here to extract the decimal part of a number. Divide a number containing a decimal by 1 and return the remainder. Humm. Very clever.

  8. Tomer says:

    Thanks very much, extremely useful !

Leave a Reply