Posts

Showing posts from 2017

Use Excel to parse text to hours

Image
I use a tool that displays elapsed time in the format of Xd Xh Xm, for days-hours-and minutes. If it's less than 1 day, then the output is Xh Xm. It's easy for me to scrape the output, but I need it in hours to manipulate it further. Example outputs and converted results: 2d 0h 18m = 48.3 (in hrs) 14h 9m = 14.15 (in hrs) I wrote an Excel function to accomplish this task. Assuming my output is in cell B3, this is the function. =IF( ISERROR (FIND("d",B3)),LEFT(B3,FIND("h",B3)-1)+(MID(B3,FIND(" ",B3,FIND("h",B3))+1,FIND("m",B3)-FIND(" ",B3,FIND("h",B3))-1)/60),( LEFT(B3,FIND("d",B3)-1) *24)+ MID(B3, FIND(" ",B3,FIND("d",B3))+1 ,FIND("h",B3)-FIND(" ",B3,FIND("d",B3))-1) +( MID(B3, FIND(" ",B3,FIND("h",B3))+1 ,FIND("m",B3)-FIND(" ",B3,FIND("h",B3))-1 )/60)) Notice it starts with an IF s

Is your Mac shutting down after it goes to sleep?

Image
This eluded me for some time! Usually it didn't go all the way through the shut down, as there were files that needed saving. Either way, it was a pain getting going after my Mac was asleep. This is how I solved it. Go to System Preferences... > Security & Privacy Select the padlock in the lower-left. A user name/password dialog box will open. If you don't have the correct privileges for your Mac, you may be stuck at this point. Enter your user name and password. The padlock icon will change to an open padlock; The Advanced... button will no longer be grayed out/unaccessible. (See the image below.) Select the Advanced... button. Uncheck the box proceeding "Log out after _XX_ minutes of inactivity." Select OK Close the Security & Privacy preferences dialog box. That did solve the issue for me. I've heard from others that had similar issues, and what finally solved it for them was to make sure their hard disks didn't go to s

Simple notification script for Google Sheets

Image
UPDATED: May 19, 2017 I changed the script to be more user-friendly and the ability to include HTML in the email body. I also found that Google moved a few things in the menus, so I modified the instructions as appropriate. Google Sheets has a nice feature to notify yourself if something has changed, but every person who wants to be notified must add a notification for themselves. With a simple script, you can send notifications to people of your choosing. In this example, I've written a script to send an email when 1 or more rows are added. Get started. Go to the sheet Find a cell in the sheet that wont ever be over-written. Enter the value of the current total number of rows in the sheet. Note the cell for use in your script. I used G2. Go to Tools > Script editor... Write your script. Add this script in the script editor. Change as required to meet your needs. function check4NewLines() {       // /////////////// //////////////// ////////////////