If you have a field with a time in hours : minutes : seconds format and would like to convert that to a more usable format try the following formula. Worked for me.
=(hours(A1)*3600)+(minutes(A1)*60)+(seconds(A1))
SharePointers
SharePoint tips and tricks from a SharePoint developer
Thursday, January 2, 2014
Tuesday, September 3, 2013
Inserting Blank Rows Between Multiple Rows of Existing Data in Excel
So today I was faced with a problem that I hadn't had to solve for before. I needed to create a schedule for an entire year with 8 rows for each day to account for 8 hrs in each of those days. I only wanted weekdays since it's a work schedule. So to get the dates for 2014 of just the weekdays was easy enough in Excel 2010. Just start with 1/1/2014, a Wednesday, fill 261 rows down and then in the little fill options screen select "Fill Weekdays". Boom, weekdays only. But the next part of my problem is that I need the weekday but then each weekday needs room for 8 hours each. What I did was added a column next to my list of dates and numbered them from 1 - 261. I then took that column and copied it's contents and pasted it below itself 8 times. So now I have the sequence of 1 - 261 repeated 8 times. The first sequence has my weekday dates next to it but the other 8 have a blank cell. Now, if I then select the entire range and turn on AutoFilter and sort this smallest to largest based on the sequence field I magically have inserted 8 rows between each row with a date.
Tuesday, September 4, 2012
Add a web part to NewForm.aspx or EditFrom.aspx
There are times when you may want to add a webpart to the new item form or the edit item form of a list. Sometimes it may be to add code that will interact with the form or to simply add a message at the top of yoru form. Whatever the reason, it isn't obvious how to do it.
So go to your site and replace everything after the below depending on which form with:
So go to your site and replace everything after the below depending on which form with:
&PageView=Shared&ToolPaneView=2EditForm.aspx
http://mycompany.com/MyCollection/MySite/Lists/MyList/EditForm.aspx?ID=213NewForm.aspx
http://mycompany.com/MyCollection/MySite/Lists/MyList/NewForm.aspx?DispForm.aspx
http://mycompany.com/MyCollection/MySite/Lists/MyList/DispForm.aspx?ID=213
Friday, August 24, 2012
Left align a number, currency, or percentage column in a SharePoint list.
Sometimes when you're being finicky about how a list appears on SharePoint you might find that you don't like the way it looks when number-type fields are right aligned by default. This is generally how the fields would look in Excel but that isn't always the best way to display them.
One simple way to fix this is to create a calculated column based on the original column that you'll use in your view.
If you create a calculated column and select "single line of text" as the data format you'll have a left aligned field. There are a couple things you'll want to keep in mind when using this method. If there are blanks in your source field the calculated column will show these as a zero. To avoid this you can change your calculated field to this.
If you're trying to left align a currency field you'll need to add code add the dollar sign back in.
One simple way to fix this is to create a calculated column based on the original column that you'll use in your view.
If you create a calculated column and select "single line of text" as the data format you'll have a left aligned field. There are a couple things you'll want to keep in mind when using this method. If there are blanks in your source field the calculated column will show these as a zero. To avoid this you can change your calculated field to this.
=IF([Source Column]<>"",[Source Column],"")This will have any blanks appear as blanks, not zeros.
If you're trying to left align a currency field you'll need to add code add the dollar sign back in.
=IF([Source Column]<>"","$" & [Source Column],"")Percentage is not so straight forward since 23% will be displayed as 0.23 using this method. If we multiply the number by 100 and attach a percentage symbol we should have a left aligned percentage.
=IF([Source Column]<>"",[Source Column]*100&"%","")
Thursday, August 23, 2012
Common formulas for calculated fields
I'm linking to a Microsoft site which gives commonly used formulas for SharePoint calculated fields. Which I recently used to subtract months from a date. I started by simply subtracting a rough number of days from my date field but that isn't exactly the same as subtracting months since months have different numbers of days. So instead of using
=IF([Go Live]<>"",[Go Live]-243,"")I used
=IF([Go Live]<>"",DATE(YEAR([Go Live]),MONTH([Go Live])-8,DAY([Go Live])),"")Which nicely subtracted 8 months from the field regardless of what the date was. This same concept can be used to add/subtract years and/or days. Here's the complete list of Examples of common formulas.
Wednesday, August 22, 2012
How to word wrap the column headers in a SharePoint List
I always get asked how to save space in a SharePoint list where the data in a column is much smaller than the name of the column. Until I found this I would abbreviate the column to the point where you'd need a key in order to figure out what it meant.
Add a content editor web part to your page that includes the code.
Thanks to Pentalogic for the original article.
Add a content editor web part to your page that includes the code.
Hide that content editor web part and voila, you've saved a bunch of room with very little effort.<style type= "text/css">.ms-vh, .ms-vh2-nograd, .ms-vh2, .ms-vb{white-space: normal}</style>
Thanks to Pentalogic for the original article.
Subscribe to:
Comments (Atom)