I needed to compare two Excel workbooks produced with Microsoft Excel for
Mac (version 16.29) on my
Pro laptop. Unfortunately, the MAC version of Excel doesn't include a
capability to directly compare two workbooks. Since both workbooks only had one
worksheet in them, I created a new workbook and then copied the
contents of the worksheet in the first workbook to Sheet1 in the
new workbook and the contents of the worksheet in the second workbook
to Sheet2 in the new workbook. I copied the contents of the
worksheets by selecting Edit and then Select All
in a worksheet and then pasting the contents into a sheet in the
new workbook. I then created a third worksheet, Sheet3 in the new
workbook. In cell A1 in that workbook, I put the formula
=IF(Sheet1!A1 <> Sheet2!A1, "Sheet1:"&Sheet1!A1&" vs
Sheet2:"&Sheet2!A1, ""). I clicked in that cell and then
clicked on Edit and then Copy. Since the columns
in both of the worksheets I wanted to compare extended to AE with
804 rows, I then selected all of the columns from A to AE and all
rows from 1 to 804 and then clicked on Edit and then
Paste Special with All selected. I then clicked
on OK to copy the formula throughout the new worksheet.
Excel automatically updates the references so that B2, for instance,
gets the formula =IF(Sheet1!B2 <> Sheet2!B2,
"Sheet1:"&Sheet1!B2&" vs Sheet2:"&Sheet2!B2, "").
Excel then showed the differences between Sheet1 and Sheet2 in Sheet3
where I had used a formula to compare cells in the two other sheets.
If the contents of a cell differed, Excel showed the differences.
E.g. for cell A71, I saw Sheet1:I13-0003 vs Sheet2:I97-0033, since
Sheet1 had I13-0003 in that cell whereas Sheet2 had I97-0033
. If the cells matched, the corresponding cell in Sheet3 was empty.
So, even though the Mac version of Excel doesn't include the workbook
comparison feature found in Windows versions of the program described at
How to compare two Excel files for differences, you still may be able
to compare sheets in two Excel files by copying relevant sheets into a new
sheet where you can see the differences displayed. In the exmple above, the
contents of E71 in Sheet3 showed the values for the other sheets as numeric
values, though there were dates in the corresponding cells in Sheet1 and
If you have an Excel workbook containing two cells that contain
a date and time and you want to know the time difference between
them in days and hours, you can subtract one from the other and get
the elapsed time between the two timestamps in days and hours by
using a custom date and time format for the cell that will hold the
results. E.g., suppose I have a
spreadsheet with the following
in columns A and B:
The cells containing the date and time have the custom format
Click on Excel at the top, left-hand corner of the Excel window and
the select Preferences.
On the Excel Preferences window, click on View in the
In the View window, click on the check box next to Developer tab,
which you will see in the In Ribbon, Show section.
You can close that window by clicking on the "x" in the red circle at the
top, left-hand corner of the window. You should then see Developer
as a selectable option to the right of Data, Review, and View on the menu
bar at the top of the Excel window.
If you click on the Developer tab, you should see options that
include Visual Basic, Macros, Record Macro, Add-ins, Excel Add-ins, Button,
Group Box, Combo Box, Label, Check Box, Scroll Bar, List Box, Option Button,
If you see an error message like the one below, which was produced by Microsoft
Excel for Mac 2016 on a Mac OS X system, even though you don't have the file
open currently, then you will need to delete the lock file, which
should be in the same directory as the spreadsheet.
This file is locked for editing.
Locked by: John Doe
You can open the file as read-only.
The lock file will have the same name as the workbook you were trying
to open, but the file name will have ~$ prepended to it. To
delete the file you will need to "escape" the meaning of the dollar sign
by putting an escape character, i.e., a backslash character, immediately
before the dollar sign. I.e., use ~\$ as shown below:
$ ls -alg **SGRS_2017.xlsm
-rw-rw-r--@ 1 ABC\Domain Users 761327 Sep 13 15:57 SGRS_2017.xlsm
-rw-rw-r--@ 1 ABC\Domain Users 171 Sep 18 22:46 ~$SGRS_2017.xlsm
$ rm ~$SGRS_2017.xlsm
rm: ~.xlsm: No such file or directory
$ rm ~\$SGRS_2017.xlsm
Once the lock file has been deleted, you should be able to open the
file without the warning message that it is locked for editing.
You can use the LEFT and RIGHT functions in
the Microsoft Excel
spreadsheet program along with the LEN (length) function to remove the leftmost
or rightmost character from a text
string. These functions also work in
which is the spreadsheet component of the
Apache OpenOffice Calc, which is the spreadsheet program included in
though in the Apache OpenOffice Calc program you need to substitute semicolons
(;) for commas (,) in the formulas. E.g.,
in Apache OpenOffice Calc you would need to use =RIGHT(A5;LEN(A5) -1)
, instead of =RIGHT(A5,LEN(A5) -1) as you would in the other
Removing the leftmost character
The syntax for the RIGHT function is RIGHT(text,[numchars]).
If you don't include numchars, i.e., you use RIGHT(text)
then the value returned is the rightmost character in the string. E.g.,
if cell A1 has 1ABC in it, then =RIGHT(A1) returns
C. But suppose, instead, you want to remove the leftmost
charaacter from a string. You can use the RIGHT function to do
so. E.g., suppose I have a column of values, e.g.:
If I want to remove the number at the beginning of each text
string and put the shortened strings in column B, I could, since the
strings are all 4 characters long, use =RIGHT(A1,3) in column B1
and then copy the formula down through the other cells in column B by clicking
in cell B1 and holding down the leftmost mouse button and dragging downwards
through the other cells in column B and then hitting Ctrl-D.
But suppose the strings vary in length. I.e., suppose I have a worksheet
containing the following strings in column A:
Microsoft Excel supports formatting
in a workbook as a date followed by a time with an AM or PM value, i.e., the
times are in 12-hour clock format where noon is 12:00 PM and
midnight is 12:00 AM. You can select that format for a cell or
column in a worksheet by highlighting the cell(s) or column (a
column can be selected by clicking on the letter at the top of the
column) and then clicking on Format then Cells and
then clicking on Date and selecting a type of "3/14/15 1:30
If you wanted to extract just the hour from the timestamp, you can use
the HOUR function, e.g. =HOUR(A1) to extract the hour
value from cell A1. The hour will be displayed in 24-hour clock format, aka
military time, i.e., 7:00 AM is 7 while 7:00 PM
is 12 plus 7, i.e., 19; 12:00 AM (midnight) is 0 and 12:00 PM (noon) is 12.
If you wish to know whether a cell holds a
Uniform Resource Locator (URL), such as http://example.com, in
Google Sheets you can use the ISURL function.
E.g., if I wanted to know whether cell A5 contains a URL, elsewhere in the
spreadsheet I could use the formula =ISURL(A5). The value returned
will be either TRUE or FALSE. Note: this will return
value TRUE or FALSE only if the text in the cell is a URL. If, instead, I
have =hyperlink("http://superuser.com","Super User"), i.e., I
have text in the cell that is hyperlinked, the value will be FALSE, because, in the
example, the text that appears in the cell will be Super User.
This function is not available in
Microsoft Excel, at least as of Excel 2013 for Windows and Microsoft
Excel for Mac 2016 (version 15.29), which is part of
Microsoft Office 2016 for OS X and macOS systems. Nor is it available for
Calc, at least as of version 4.1.1. If you try using ISURL as a formula
in those applications, you will see #NAME? appear in the cell
where you place the formula, since its usage is an incompatibility between
those versions and Google Sheets.
The ISURL formula will return TRUE for other URLs besides HTTP or HTTPS
ones. E.g., FTP and mailto URLs will also result in a value of TRUE.
E.g., if a cell contains any of the following URLs, an ISURL formula that
checks the content of the cell will return TRUE.
I wanted to add another sheet to an
Excel workbook, but when I clicked on the "+" to add the additional
worksheet, I saw the message "Workbook is protected and cannot be changed."
I didn't know what the password might be because I had never set a
password for the workbook, which I had created in a prior version of Excel;
I'm using Microsoft Office 2016 on a
Pro running OS X El Capitan (10.11.6) at the moment.
To add a
checkbox (check box, tickbox, tick box) column in
Microsoft Excel, you will need to first enable the developer ribbon
in Excel, if it is not already enabled. To do so, take the following steps in
Excel (the steps were written for Excel 2010 and 2013, but may be similar for
I often receive Microsoft Excel files that have documents created by
other Microsoft applications embedded within them. E.g., at the top of
a worksheet I may see something like =EMBED("Visio.Drawing.11","").
Sometimes I want to extract the embedded file. With a Microsoft Excel .xlsm
file that is easy to do, because XLSM is a
XML-based file format. To extract embedded documents, such as
PowerPoint presentations, I make a copy of the .xlsm file then rename the
copy's extension from .xlsm to .zip. I can then extract the contents of the zip
file. Within the directory that holds the extracted files, there will be a
xl directory. Within that directory there is a media
directory and within the media directory there is an
embeddings directory that holds the embedded files, such as the
Visio drawings in the example below.