Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Power excel 2016 with mrexcel Master Pivot Tables, Subtotals, Charts, VLOOKUP, IF, Data Analysis in Excel 2010–2013 (Bill Jelen) (z-lib.org).pdf
Скачиваний:
4
Добавлен:
14.08.2022
Размер:
49.75 Mб
Скачать

224

POWER EXCEL WITH MR EXCEL

 

 

To switch to the 1904 date system, use File, Options, Ad- vanced. Scroll down to When Calculating in This Work- book. Turn on the check box for Use 1904 Date System.

Excel will now display negative times.

Figure 559 E6 displays correctly, but column A is wrong.

Figure 558 Convert the workbook to the 1904 date system.

Gotcha: Use care when changing to the 1904 system. Any existing dates will instantly increase by 4 years and a day as seen above in column A.

Additional Details: If someone’s opening balance is negative, you enter a time of -2:00 in E2.

FILL BLANKS WITH VALUE ABOVE

Problem: Someone set up data in an outline view. I need to sort by columns A, B, and C, so I need all of the blanks filled in.

Figure 560 Fill in the blanks.

Strategy: Use Go To Special to select the blank cells. Then, 3 simple keystrokes will fill in the blank cells with the value above. Follow these steps.

1. Select from A3 down to the last blank in column C. 2. Select Home, Find and Select, Go To Special.

3. In the Go To Special dialog, choose Blanks and then click OK.

4. Type and equals sign and press the up arrow. This will create a formula that points up one cell.

PART 2: CALCULATING WITH EXCEL

225

 

 

Figure 561 Equals, Up Arrow.

5.Press Ctrl+Enter to fill all of the selected cells with a similar formula.

6.Before you can sort, you need to convert the formulas to values. Paste Values does not work on a non-contiguous selection, so you have to re-select columns A:C

7.Ctrl+C to copy

8.Home, Paste dropdown, Paste Values to convert the formulas to values.

2

Figure 562 All of the blank cells are filled in.

SEE FORMULAS IN EXCEL 2013

Problem: I need to audit several formulas. I already know how to use Show Formulas mode, but I need something more permanent.

Strategy: Use the new =FORMULATEXT() function in Excel 2013.

Figure 563 FORMULATEXT is great for documenting, and also for catching shenanigans.

CREATE A BELL CURVE IN EXCEL

Problem: I need to generate a bell curve in Excel. The mean is 50 and the standard deviation is 12. (In the formulas below, substitute your real mean and standard distribution for the 50 and 12.)

Strategy: You curve needs to start three standard deviations below the mean. Follow these steps: 1. In cell A2, enter =50-12*3

2. In cell A3, enter =A2+(12*6)/60

3. Copy A3 down to A4:A62. This gets you 61 data points; 30 on either side of the mean. 4. In cell B2, enter =NORM.DIST(A2,50,12,FALSE). Copy that to B3:B61.

5. Enter a heading in B1, such as Probability

226

POWER EXCEL WITH MR EXCEL

 

 

6. Select A1:B62. Insert a Line chart.

Figure 564 A couple of formulas will generate a bell curve in Excel.

Additional Details: With a Normal distribution, 99.8% of the probability falls within 3 standard deviations of the mean. The formula in A2 starts 3 standard deviations below the mean. Experience has taught me that using 61 data points is enough to create a fairly smooth curve. Thus, the formula in A3 is designed to cover six standard deviations over the course of 60 more rows.

The real workhorse here is the NORM.DIST function. You have to plug in the mean and standard devia- tion for the desired bell curve to make it work.

CHANGE FROM LOWER TO UPPER CASE IN EXCEL

Problem: I have data in lower case. I need to convert it to upper case. Strategy: To solve this in Excel, follow these steps:

1.

Insert a new blank column to the right of your data.

 

2.

Use a formula such as =UPPER(D2). To convert to low-

 

 

er case, use =LOWER(). To convert to Proper case, use

 

3.

=PROPER().

 

Copy the temporary formula down to all rows by double-

 

4.

clicking the fill handle.

 

The entire range of new formulas will be selected. Press

 

 

Ctrl+C to copy.

 

5.

Press the left arrow to move to the original data. Right-

Figure 565 Fix in a temp column.

 

click and choose Paste Values.

 

6. You can now delete the temporary column D.

Additional Details: I to bring up the “W” program again, but here is an- other place where Microsoft Word could make this easier. If you had an entire table that needs converting, select the whole table, paste to a blank word document, then use the Change Case dropdown in the Home tab.

After the conversion is done, copy from Word and paste back to Excel.

Figure 566 Word.

Figure 568 This setting allows macros to run.

PART 2: CALCULATING WITH EXCEL

 

227

 

 

 

SPELL OUT NUMBERS IN EXCEL

Problem: I need to spell out numbers in Excel, like on the old check writer machines.

Strategy: Use the SpellNumber VBA function from Microsoft.

Figure 567 The SPELLNUMBER function is not built into Excel. Read on.

This function is not built into Excel. Microsoft publishes the code on their website. Read the next topic to learn how to copy that code into your workbook.

COPY MACRO CODE FROM THE INTERNET INTO AN ADD-IN

Microsoft publishes a Knowledge Base article with the code to make SpellNumber work. If you have never

used VBA before, it can be somewhat intimidating the first time you want to copy a macro from the web 2 into your Excel file.

If you have never used macros before, you need to change your macro security settings to allow macros to run. In Excel, press Alt+T, followed by the letters M and then S. You will be at the macro security settings. Initially, the settings are set to disable all macros without notification. You want to choose the second item, which is Disable all Macros With Notification.

1. Open a completely blank workbook.

2. Press Alt+F11 to open the Visual Basic Editor.

3. Once inside VBA, press Ctrl+R to display the Project Explorer. This is a small window that shows all open workbooks and add-ins.

4. In the Project Explorer, find the new file. Click on the file in Project Explorer. From the VBA menu, select Insert, Module.

5. Go to the Internet and search for SpellNumber Excel. The first result should be a Microsoft Knowl- edge Base article. In 2014, that article was number 213360, but the article is updated every few years, so don’t be surprised if the number is new.

6. Select all of the code in the article, from Option Explicit through End Function. 7. Switch back to Excel VBA and paste the code in an empty module.

8. Press Alt+Q to close VBA and return to Excel.

9. For a quick test, type =SPELLNUMBER(123) in a cell and press Enter. You should get the words spelled out.

Gotcha: This function will only work in this workbook. You might be thinking that you could save it your personal macro workbook so it will work all the time, but then you will have to start typing the file name before the function. If you really need to use this function all the time in all workbooks on your computer, then the best solution is to make the function into an Add-In.

1. Use File Save As to save an XLSM version of the workbook first.

2. Use File Save As to save an XLAM version of the workbook. When you choose XLAM, Excel will offer to save in the Add-Ins folder.

3. When you save the XLAM version, the workbook becomes hidden, so it seems like it is not open anymore.