Book

Suggestions


Enter your email address:

Delivered by FeedBurner


Home Page

Bloglines

1906
CelebrateStadium
2006


OfficeZealot

Scobleizer

TechRepublic

AskWoody

SpyJournal












Subscribe here
Add to 

My Yahoo!
This page is powered by Blogger. Isn't yours?

Host your Web site with PureHost!


eXTReMe Tracker
  Web http://www.klippert.com



  Friday, April 20, 2018 – Permalink –

Week Numbers

Who's counting?


For most purposes, weeks are numbered with Sunday considered the first day of the week. This works most of the time, but it can be a little confusing certain years.

2004 had 53 weeks. January 1 is the only day in the first week of 2005. Week 2 starts on Sunday 1/2/2005.

Chip Pearson is the Date and Time guy:
Week Numbers In Excel

"Under the International Organization for Standardization (ISO) standard 8601, a week always begins on a Monday, and ends on a Sunday. The first week of a year is that week which contains the first Thursday of the year, or, equivalently, contains Jan-4.

While this provides some standardization, it can lead to unexpected results - namely that the first few days of a year may not be in week 1 at all. Instead, they will be in week 52 of the preceding year! For example, the year 2000 began on Saturday. Under the ISO standard, weeks always begin on a Monday. In 2000, the first Thursday was Jan-6, so week 1 begins the preceding Monday, or Jan-3. Therefore, the first two days of 2000, Jan-1 and Jan-2, fall into week 52 of 1999.

An ISO week number may be between 1 and 53. Under the ISO standard, week 1 will always have at least 4 days. If 1-Jan falls on a Friday, Saturday, or Sunday, the first few days of the year are defined as being in the last (52nd or 53rd) week of the previous year.

Unlike absolute week numbers, not every year will have a week 53. For example, the year 2000 does not have a week 53. Week 52 begins on Monday, 25-Dec, and ends on Sunday, 31-Dec. But the year 2004 does have a week 53, from Monday, 27-Dec , through Friday, 31-Dec."

The first week of 2005 should start on January 3. The first and second would be part of week 53 of 2004.

Wikipedia:
Week Dates

If your week starts on a different day, you can use the Analysis ToolPac function:
=WEEKNUM(A1, 2) for a week that starts on Monday, =WEEKNUM(A1) if it starts on Sunday.

Also this from ExcelTip.com:
Weeknumbers using VBA in Microsoft Excel

"The function WEEKNUM() in the Analysis Toolpack addin calculates the correct week number for a given date, if you are in the U.S. The user defined function shown here will calculate the correct week number depending on the national language settings on your computer."

In Access:
DatePart Function

If your work week is always Saturday through Friday then
datepart("ww",[DateField],7,1)

will return 1 for 1/1/2005 through 1/7/2005, 2 for January 8-14/2005, etc.
Otherwise use 1 for Sunday through 7 for Saturday.

The last number sets these parameters:

1, Start with week in which January 1 occurs (default).
2, Start with the first week that has at least four days in the new year.
3, Start with first full week of the year.


See all Topics

Labels: , , , , ,


<Doug Klippert@ 3:25 AM

Comments: Post a Comment


  Wednesday, April 04, 2018 – Permalink –

Camera Tool

Smile!


(This is the pre-2007 routine. For 2007+ see the end. )

To create a linked picture of part of a spreadsheet for use elsewhere:
  1. Edit>Copy the Cell or Range
  2. Choose the target cell
  3. Hold down the Shift key and choose Edit>Paste Picture Link
If you're going to do this frequently, go to Tools>Customize. Choose the Commands tab and locate Camera in the Tools category. Drag to place the Camera button on your toolbar.



If the Camera tool is on your toolbar:
  1. Select the Cell/Range
  2. Click the Camera tool
  3. Move the cursor to the target position and click to insert the linked picture
To create a static picture from cells, or a chart to use in another part of your workbook, or another program:
  1. Clear cell gridlines if you do not want them displayed in your picture.
    (Click Options on the Tools menu, click the View tab, and then clear the Gridlines check box")

  2. On the worksheet or chart sheet, select the cells or click the chart you want to copy as a picture
  3. Hold down SHIFT and click Copy Picture on the Edit menu
    (For the best picture quality, make sure As shown on screen and Picture are selected)
  4. Click OK
  5. Select the worksheet or other document where you want to paste the picture
  6. Edit>Paste.
You can use the Picture toolbar to change the image. (to display the toolbar, right-click any toolbar and choose Picture) To paste information you've copied from another program as a picture in Microsoft Excel, hold down SHIFT and click Paste Picture or Paste Picture Link on the Edit menu. You can, also, create a dynamic linked text box by using the tool on the Drawing toolbar to place the object on the worksheet.
Now click to the Formula box. Type = and the click on the cell you wish to link.

Also see:
Copy - Paste Methodology
by Jon Peltier
 
The process is a little different in 2007+. Either add the Camera tool to the Quick access toolbar, or just select the range and drop down the Paste options. Choose copy as Picture. Next pick a location and  choose Paste as picture.


See all Topics

Labels: , , , , , ,


<Doug Klippert@ 3:16 AM

Comments: Post a Comment


  Thursday, February 15, 2018 – Permalink –

Match Format Paste

Copy/Paste formatting in Word, PowerPoint or Excel



When you copy information from a Web page or another document, the formatting will also be copied.

To match the formatting of the target document, copy the text and place the cursor where you want to insert the copy.

Then, go to Edit>Paste Special, and select the Unformatted Text option.
(Click the arrow under Paste in the Clipboard group on the Home tab in 2007+)

The clipboard text will be pasted to match the target.

Another way when using Word 2002 + is to click on the "Smart icon" that appears at
the lower right corner of the pasted text. You can then choose to keep the original formatting, match the destination formatting, keep text only, or apply a new style.

An additional way to transfer just the formatting between documents is to highlight the text with the formatting you wish to copy and then hold down the Ctrl key and the Shift key and press the C key (Ctrl+Shift+C). Release the keys. Select the text you want to have formatted. Hold down the Ctrl key and the Shift key and press the V key (Ctrl+Shift+V). Only the formatting is copied, not the text.
In Excel use Edit>Paste Special and select the "Formats" option.


What's So Special About "Paste Special"? Video

Paste Special can also be used with graphics.

You can change Word's default behavior; choose whether to paste Inline or Floating.

Microsoft Word MVPS FAQ


See all Topics

Labels: , , , ,


<Doug Klippert@ 3:57 AM

Comments: Post a Comment


  Wednesday, February 14, 2018 – Permalink –

Spreadsheet Bloat

Formatting bloat



Avoid applying formatting to more than just the active area of your worksheet. Extraneous formatting will confuse Excel about the last cell in the spreadsheet.

Depending on your OS and specific configuration, you could see symptoms ranging from Excel not responding to various error messages concerning page faults, low virtual memory, and access violations. You may see a warning message; "Too many different formats."

To resolve this issue, make sure you select only the particular range of cells you want formatted when you apply specific formatting or select Format>AutoFormat.

You can use Ctrl+End to see where Excel thinks the last cell is.
For more information, check out:

How to reset the last cell in Excel

Also see:

Spreadsheet Diet

Microsoft:
Formatting Cleaner Add-in


See all Topics

Labels: , , , , ,


<Doug Klippert@ 3:59 AM

Comments: Post a Comment


  Sunday, January 28, 2018 – Permalink –

Date Arithmatic

The drunken cousin


Working with dates has a few twists.

Excel believes that time began on January 1, 1900.

Each day since then is counted so that September 1, 2003 in Excel-speak would be → 37,865.
9/1/03 7:33 A.M. is a decimal → 37865.31458333333

When you subtract one date from another, for instance 9/1/2003 (A1)minus 7/4/2001 (A2),
Excel displays the odd answer of → 2/27/1902.

Excel formats the result of a formula with the same format as the source cells,
Right-click the formula cell (=A1-A2).
Select Format Cells ..., and then choose a Number format with zero decimals.

The correct number of days → 789 will now be displayed.

Another way is to use the rarely documented DATEDIF function. Chip Pearson calls it "the drunken cousin of the Function family."

=DATEDIF(EarliestDate,LatestDate,Interval)

=DATEDIF(A2,A1,"d")


Here's THE source for date math:
Chip Pearson:
All About Dates
Also:

John Walenbach:
Extended Date Functions Add-In
"Many users are surprised to discover that Excel cannot work with dates prior to the year 1900. The Extended Date Functions add-in (XDate) corrects this deficiency, and allows you to work with dates in the years 0100 through 9999."


MS Knowledge Base:
How To Use Dates and Times in Excel



See all Topics

Labels: , , , , , , ,


<Doug Klippert@ 3:42 AM

Comments: Post a Comment


  Wednesday, January 24, 2018 – Permalink –

Reset Shortcut Menu

Context menu redo


For some reason (to be determined later) my shortcut menu started to accumulate a string of "Edit Formula" and "Delete Formula" entries.

They didn't cause a problem, but were distracting.

This little VBA code puts it back to the original settings until I can find a cause.



Sub ResetShortcutMenu()
Application.CommandBars("Cell").Reset
End Sub


Macros that Customize and Control Shortcut Menus


See all Topics

Labels: , , , ,


<Doug Klippert@ 3:04 AM

Comments: Post a Comment


  Friday, January 19, 2018 – Permalink –

Chiropractics for Excel

Knead and pound numbers

Chad Rothschiller, a program manager on the Excel team, discusses using formulas to 'clean up' data in Excel.
Excel is a great tool to use when you need to take data in one format, manipulate it into another format, and push the results along to another process, e.g. a database. In this context, Excel is a great landing pad or middle man, serving as a data transformation tool to move data from one system to another.

This example considers a sample data set and walks through the steps to clean up the data and perform various transformations on the data set to massage it into a more desirable format.

I'm sure you've been faced with at least one of theses problems:

  • Import the data and don't accidentally drop the leading zeros!

  • Formatting SSN

  • Inserting hyphens

  • Fixing up names

  • Lower case E-Mail Address

  • Format Home Phone

  • Inserting parenthesis & hyphens

  • Trim extra spaces from Address

  • Add City values to the new table

  • Make all State value upper case

  • Fill in Postal Code

  • Finalize the values
Manipulate and massage  


See all Topics

Labels: , , , ,


<Doug Klippert@ 3:54 AM

Comments: Post a Comment


  Monday, January 08, 2018 – Permalink –

Web Data

Numbers from the ether


Excel has had a feature called web query. Here's an add-in that makes it a little easier.

"The Excel 2007 Web Data Add-In makes it easy to use a Web page as a data source in Excel.

The add-in plugs into Excel 2007 seamlessly, its entry point located on the Data Tab under the From Web option. The system extracts data by learning from a user’s selection of data they wish to capture into Excel. The more selections, the more the system is trained."



Web Data

Getting data from the Web in Excel

2013 Web Data YouTube


See all Topics

Labels: , , , , , ,


<Doug Klippert@ 3:57 AM

Comments: Post a Comment


  Tuesday, December 19, 2017 – Permalink –

Loan Payment

Basic tutorial


Microsoft provides a number of learning activities related to fundamental tasks.

Here's one that walks the student through a worksheet designed to calculate interest and total payment for a purchase, based on different loan terms.

"This practical spreadsheet lesson offers easy answers to life's perplexing math problems like How much will my dream car really cost after financing?

Students will calculate the cost of purchasing their very own Lamborghini sports car and determine if the ultimate price tag is really worth the investment. "

Dream Car
Also:
Basic Financial Calculations


See all Topics

Labels: , , , , , , ,


<Doug Klippert@ 3:23 AM

Comments: Post a Comment


  Tuesday, October 31, 2017 – Permalink –

Calculate Running Total

Using the OFFSET function


Adding up a running balance can be frustrating when new data is added or old transactions are removed.
"How to create a data list to manage transactions, add and delete rows from the list, and accurately calculate a running balance using the OFFSET function."
Cash flow using OFFSET.PDF

Office.Microsoft.com:
Calculate a running total


See all Topics

Labels: , , , , , ,


<Doug Klippert@ 3:13 AM

Comments: Post a Comment


  Thursday, October 26, 2017 – Permalink –

Insert Line Breaks With Code

Label Captions


If you've ever needed to insert line breaks in a message box prompt, you most likely built a string that incorporated a line feed or carriage return character. Unfortunately, label objects aren't as forgiving when it comes to using these characters.

If you're setting a label's Caption property with code, you'll find that the special control characters are interpreted as squares, since they're otherwise un-displayable.
To successfully insert a line break in a label caption, you need to include both a line feed character and a carriage return character, entered consecutively.

To do so, you can use the Chr() function, such as:

Me.Label1.Caption = "Line 1" & _
Chr(13) & Chr(10) & "Line 2"

However, you can also simplify your code using an built-in constant:
Me.Label1.Caption = "Line 1" & vbCrLf & "Line 2"



See all Topics

Labels: , , , , , ,


<Doug Klippert@ 3:08 AM

Comments: Post a Comment


  Wednesday, September 06, 2017 – Permalink –

Move a Column

No Cut, No Paste


With a little practice you can quickly move columns or rows.

  1. Select the entire column or row you want to move
    The move will effect whatever is selected; cells, or columns, or rows

  2. Move your mouse pointer to the edge of the selection until it changes from a normal pointer cross to an arrow (four headed arrow in 2007+).
    (Put the pointer on the selected cells, not the Row or Column indicators.)

  3. Hold down the shift key and click the left mouse button and drag the column/row to the new position.

  4. Release the mouse button before releasing the shift key



See all Topics

Labels: , , , ,


<Doug Klippert@ 3:21 AM

Comments: Post a Comment


  Thursday, August 31, 2017 – Permalink –

Tips and Formulae

Functions and Macros



I'm always looking for Excel sites. A fresh perspective can make the view more clear.
While he does approach from a Mac angle, the Excel world welcomes those of all persuasions.

J.E. McGimpsey's XL Pages

Here are some of the tips:

  • Remove internal worksheet/workbook protection
  • Why your sum is a penny off...
  • Highlight row without losing color formatting
  • Why use -- in SUMPRODUCT formulae
  • Using SUMPRODUCT() to calculate variable rates and commissions
  • Three-dimensional SUMIF()s
  • Bitwise Logical Functions
  • Sampling from a range
  • Summing every Nth column or row
  • Worksheet and Workbook names using the CELL() function



See all Topics

Labels: , , , , , ,


<Doug Klippert@ 3:15 AM

Comments: Post a Comment


  Monday, July 31, 2017 – Permalink –

Drop Down Menu

Validation



You can create a dropdown list that gets its choices from entries located in another part of the spreadsheet.

  1. Type the entries in one column or row.

    You can name the list by selecting the entries and then clicking in the Name box on the Formula bar and entering a name, and then press Enter.

  2. Next, select the cell where you want the dropdown list.

  3. On the Menu bar, go to the Data menu, click Validation, and then click the Settings tab.
    In the Allow box, click List.

  4. Enter the name of the list or its location.

    Make sure the reference or name is preceded with an equal sign (=).

    Make sure the In-cell dropdown check box is selected.

    If your list is short, you can type the entries directly in the Source box, separated by commas.
Debra Dalgleish, Excel MVP has a complete discussion on her Contextures.com site. She covers resizing the dropdown box. The site also includes other information about data validation:
Excel — Data Validation —Tips  


See all Topics

Labels: , , , , ,


<Doug Klippert@ 3:25 AM

Comments: Post a Comment


  Wednesday, July 26, 2017 – Permalink –

Hide Dups

Format don't show



Duplicate entries can be formatted to "disappear", but still be available for computation.
  1. Select the range

  2. Goto Format>Conditional Formatting

  3. Select Formula Is

  4. Enter
    =A2=A1

  5. Click the Format button.

  6. Select a font color to match the cell background color.

  7. Click OK and OK
Dups can also stand out:
  1. Select the range

  2. Go to Format>Conditional Formatting

  3. Choose Formula Is

  4. Enter
    =COUNTIF($A$2:$A$100,A2)>1

  5. Click the Format button.

  6. Select a font or background color for highlighting.

  7. Click OK and OK
Hide Duplicate Values

Also:
Hide Records with Duplicate Cell Entries


See all Topics

Labels: , , , , ,


<Doug Klippert@ 3:17 AM

Comments: Post a Comment


  Tuesday, July 04, 2017 – Permalink –

Select by Code

Programmatically pick cells


Microsoft has provided 22 ways to select cells/ranges by using Visual Basic procedures in Excel.

Here are a few of the subjects covered:

  • How to Select a Cell on the Active Worksheet

  • How to Select a Cell on Another Worksheet in the Same Workbook

  • How to Select a Range of Cells on the Active Worksheet
  • How to Select a Named Range on a Worksheet in a Different Workbook

  • How to Select a Cell Relative to the Active Cell

  • How to Select the Union of Two or More Specified Ranges

  • How to Select the Intersection of Two or More Specified Ranges

  • How to Select the Last Cell of a Column of Contiguous Data

  • How to Select the Blank Cell at Bottom of a Column of Contiguous Data

How to select cells/ranges by using Visual Basic procedures

Dick Kusleika has some comments on the coding:
Spreadsheets are the Devil


See all Topics

Labels: , , , , ,


<Doug Klippert@ 3:43 AM

Comments: Post a Comment


  Tuesday, May 02, 2017 – Permalink –

Result is a picture

If 4, show kumquat


Allen Wyatt has a cool procedure that will let you show a picture of an object on your spreadsheet depending on a value.

Maybe a snow suit when it's 29 or, say, a pair of bloomers when the computed temperature is 70.

The procedure does not use any VBA, just equations and bright thinking.

ExcelRibbon.Tips.net

Display Images based on a Result


See all Topics

Labels: , , , , , , ,


<Doug Klippert@ 3:55 AM

Comments: Post a Comment


  Monday, April 03, 2017 – Permalink –

Control Sort

Your choice

You can determine how Excel sorts your data.

ExcelTips


See all Topics

Labels: , , , ,


<Doug Klippert@ 3:27 AM

Comments: Post a Comment


  Tuesday, January 31, 2017 – Permalink –

Code Copy

Excel to Word

You can select, copy, and paste to put Excel data into a Word document, but this piece of VBA automates to process.


VBAExpress.com


See all Topics

Labels: , , , ,


<Doug Klippert@ 3:27 AM

Comments: Post a Comment


  Saturday, December 24, 2016 – Permalink –

Windows Split

Easy trick

Here's how to split the open window and/or create new windows.

SaraFord


See all Topics

Labels: , , , , ,


<Doug Klippert@ 3:38 AM

Comments: Post a Comment