Excel - IF Function Problem - Expert Solution

Question description:
This user has given permission to use the problem statement for this blog.

Hi, I'm having a problem opening my xls file. I'm getting a message saying the file is corrupt and the size is only showing as a few bytes. Before the file size was over 200MB. Trying to see what happened and if my file can be recovered...
Solved by A. C. in 60 mins
This is the chat thread from the real Excelchat help session. It contains no private user information.
User 21/08/2018 - 10:18
Hello?
Excelchat Expert 21/08/2018 - 10:18
Welcome, Thanks for choosing Got It Pro-Excel.
User 21/08/2018 - 10:18
Is this a real person?
Excelchat Expert 21/08/2018 - 10:19
Yeah, it is.
User 21/08/2018 - 10:19
Ok
Excelchat Expert 21/08/2018 - 10:19
When last did you open the file with no problems?
User 21/08/2018 - 10:19
It's been opened for a long time. Maybe a few days.
User 21/08/2018 - 10:20
But I closed it out yesterday. When I tried to re-open it says it's corrupted.
Excelchat Expert 21/08/2018 - 10:20
Was yesterday when you closed it okay?
User 21/08/2018 - 10:20
Yes
Excelchat Expert 21/08/2018 - 10:21
Have you transferred it across computers?
User 21/08/2018 - 10:21
No, nothing like that.
Excelchat Expert 21/08/2018 - 10:22
And have you added any new program, plugin or extension to your computer?
User 21/08/2018 - 10:22
Not that I'm aware of.
Excelchat Expert 21/08/2018 - 10:22
Is it Windows or Mac?
User 21/08/2018 - 10:22
Windows
Excelchat Expert 21/08/2018 - 10:23
Is it protected?
User 21/08/2018 - 10:23
What do you mean?
Excelchat Expert 21/08/2018 - 10:23
Does it have any passwords, modification, editing, opening...etc
User 21/08/2018 - 10:24
No
Excelchat Expert 21/08/2018 - 10:24
Finally, does it have macros or vba code?
User 21/08/2018 - 10:24
Yes it does
Excelchat Expert 21/08/2018 - 10:25
Okay.
Excelchat Expert 21/08/2018 - 10:25
STEP 1
Excelchat Expert 21/08/2018 - 10:25
Open Excel program
Excelchat Expert 21/08/2018 - 10:25
STEP 2
Excelchat Expert 21/08/2018 - 10:25
Click File > Open.
Excelchat Expert 21/08/2018 - 10:25
STEP 3
Excelchat Expert 21/08/2018 - 10:26
Click the location and folder that contains the corrupted workbook.
Excelchat Expert 21/08/2018 - 10:26
STEP 4
Excelchat Expert 21/08/2018 - 10:26
In the Open dialog box, select the corrupted workbook.
Excelchat Expert 21/08/2018 - 10:26
STEP 5
Excelchat Expert 21/08/2018 - 10:26
Click the arrow next to the Open button, and then click Open and Repair.
Excelchat Expert 21/08/2018 - 10:27
Open and Repair:
[Uploaded an Excel file]
User 21/08/2018 - 10:27
I tried that already
User 21/08/2018 - 10:27
I got this message:
Excelchat Expert 21/08/2018 - 10:27
Okay.
User 21/08/2018 - 10:27
Guess you can't paste here
User 21/08/2018 - 10:27
But it said "cannot open file because the file format or file extension is not valid...
User 21/08/2018 - 10:28
Verify that the file has not been corrupted and that the file extension matches the format of the file.
User 21/08/2018 - 10:29
Any other ideas?
Excelchat Expert 21/08/2018 - 10:30
What is the file extension of your file?
User 21/08/2018 - 10:30
.xlsm
Excelchat Expert 21/08/2018 - 10:31
Okay. When did you last made changes?
User 21/08/2018 - 10:31
Yesterday
Excelchat Expert 21/08/2018 - 10:32
Okay.
Excelchat Expert 21/08/2018 - 10:32
Have you tried to Revert the workbook to the last saved version
User 21/08/2018 - 10:33
No, how do you do that?
User 21/08/2018 - 10:33
I think it saved fine before closing though.
Excelchat Expert 21/08/2018 - 10:33
Okay.
Excelchat Expert 21/08/2018 - 10:34
Click File > New.
Excelchat Expert 21/08/2018 - 10:34
Under New, click Blank workbook.
Excelchat Expert 21/08/2018 - 10:34
Click File > Options.
Excelchat Expert 21/08/2018 - 10:34
In the Formulas category, under Calculation options, pick Manual, and then click OK.
Excelchat Expert 21/08/2018 - 10:35
Click File > Open.
Excelchat Expert 21/08/2018 - 10:35
Go to the folder that contains the corrupted workbook.
Excelchat Expert 21/08/2018 - 10:35
Right-click the file name of the corrupted workbook, click Copy, and then click Cancel.
Excelchat Expert 21/08/2018 - 10:36
Click File > New.
Excelchat Expert 21/08/2018 - 10:36
Under New, click Blank workbook.
Excelchat Expert 21/08/2018 - 10:36
In cell A1 of the new workbook, type =File Name!A1, where File Name is the name of the corrupted workbook that you copied in step 3, and then press Enter.
Excelchat Expert 21/08/2018 - 10:37
Note: You have to enter only the name of the workbook—you don’t have to type the file name extension.
Excelchat Expert 21/08/2018 - 10:37
If the Update Values dialog box appears, select the corrupted workbook, and then click OK.
Excelchat Expert 21/08/2018 - 10:37
If the Select Sheet dialog box appears, select the appropriate sheet, and then click OK.
User 21/08/2018 - 10:39
I got a message saying "excel cannot update one of more links in this workbook...
User 21/08/2018 - 10:39
To update the links, open all the link source files (click edit links on the data tab). To be sure all calculations are updated, press F9
Excelchat Expert 21/08/2018 - 10:41
Was it linked to other workbooks?
User 21/08/2018 - 10:41
No
User 21/08/2018 - 10:42
The file size is only showing a few bytes. Do you think this is right?
User 21/08/2018 - 10:42
If so, it looks like all my data is gone!
User 21/08/2018 - 10:43
The file size should be 200MB
Excelchat Expert 21/08/2018 - 10:43
It can show that but other data hidden.
Excelchat Expert 21/08/2018 - 10:43
Let us try also this other procedure:
Excelchat Expert 21/08/2018 - 10:43
Create a new Excel file with the same name of your lost Excel file or find your present Excel file;
User 21/08/2018 - 10:43
Ok
Excelchat Expert 21/08/2018 - 10:44
Right-click on the Excel file and select Properties;
Excelchat Expert 21/08/2018 - 10:44
Go to Previous Versions, find and select the latest version or the right version before Excel crashes, deleted or saved, click Restore.
User 21/08/2018 - 10:45
There are no previous versions showing up :(
Excelchat Expert 21/08/2018 - 10:46
Did you save it with the exact file name and extension?
User 21/08/2018 - 10:47
I just went into the properties of the current file
User 21/08/2018 - 10:47
I didn't create a new one
Excelchat Expert 21/08/2018 - 10:48
Create a new one, with the same name.
Excelchat Expert 21/08/2018 - 10:48
And file extension.
User 21/08/2018 - 10:48
In a different folder?
Excelchat Expert 21/08/2018 - 10:49
Yeah
User 21/08/2018 - 10:49
Delete the other one?
Excelchat Expert 21/08/2018 - 10:49
NO!
User 21/08/2018 - 10:49
How can I create a file with the same name then?
User 21/08/2018 - 10:50
Move the other one to a different folder?
Excelchat Expert 21/08/2018 - 10:50
In another folder.
User 21/08/2018 - 10:51
Ok
User 21/08/2018 - 10:51
Still no previous versions available
Excelchat Expert 21/08/2018 - 10:52
Copy your original to a new folder.
Excelchat Expert 21/08/2018 - 10:52
An then override it with the new one which you have created.
Excelchat Expert 21/08/2018 - 10:53
Or you can equally replace it in the same folder in which the original file is.
User 21/08/2018 - 10:53
Ok
User 21/08/2018 - 10:54
Still no previous versions
Excelchat Expert 21/08/2018 - 10:54
You are not doing it correctly.
User 21/08/2018 - 10:55
I don't have system protection turned on
Excelchat Expert 21/08/2018 - 10:55
create a file with the same name as the original file and save it in the same folder in which it is.
User 21/08/2018 - 10:55
So I don't think that'll work
Excelchat Expert 21/08/2018 - 10:55
You will be prompted to replace the original one.
Excelchat Expert 21/08/2018 - 10:56
Once prompted, replace the original one.
Excelchat Expert 21/08/2018 - 10:56
And then Right-click on the Excel file and select Properties;
Excelchat Expert 21/08/2018 - 10:57
Go to Previous Versions, find and select the latest version or the right version before Excel crashes, deleted or saved, click Restore.
Excelchat Expert 21/08/2018 - 10:57
At least it should give you a list of some of the previous versions.
User 21/08/2018 - 10:57
No
User 21/08/2018 - 10:58
I think it's because I don't have system protection turned on...
Excelchat Expert 21/08/2018 - 10:58
There is no list?
User 21/08/2018 - 10:58
So no backups were saved
Excelchat Expert 21/08/2018 - 10:58
But have you replaced it first?
User 21/08/2018 - 10:59
Yes
User 21/08/2018 - 11:03
Is it possible to do a system restore to revert back to a previous version?
Excelchat Expert 21/08/2018 - 11:04
Yeah, that can help.
User 21/08/2018 - 11:05
But system restore doesn't change files?
User 21/08/2018 - 11:05
Only settings changes and software installs and such?
Excelchat Expert 21/08/2018 - 11:06
it could be it is some virus has infected your file.
User 21/08/2018 - 11:06
No I'm sure that's not the case
Excelchat Expert 21/08/2018 - 11:06
So doing away the virus, by doing the system restore, can make it to be opened again.
User 21/08/2018 - 11:07
100% sure it's not a virus
User 21/08/2018 - 11:12
Dang
User 21/08/2018 - 11:12
I think I'm screwed :((
Excelchat Expert 21/08/2018 - 11:14
Click on File > Options.
Excelchat Expert 21/08/2018 - 11:14
Select Trust Center > Trust center settings.
Excelchat Expert 21/08/2018 - 11:14
Select Protected view.
Excelchat Expert 21/08/2018 - 11:15
Uncheck all the options under Protected View > OK.
Excelchat Expert 21/08/2018 - 11:15
Restart Excel and open the file again.
Excelchat Expert 21/08/2018 - 11:16
Most corrupted files get opened by the procedures we have tried.
User 21/08/2018 - 11:17
I think I know what happened
User 21/08/2018 - 11:17
I think I saved over the file accidently
Excelchat Expert 21/08/2018 - 11:17
What is it?
User 21/08/2018 - 11:17
Yes, that is what happened
User 21/08/2018 - 11:17
I tried to open the file with notepad and I can see that it opens there
Excelchat Expert 21/08/2018 - 11:17
That should have been found in the previous versions.

This is the output file from the real Excelchat help session:
This is an example of the expert help you can get. It contains no private user information.

Get instant expert help with Excel and Google Sheets

Post your problem and you’ll get expert help in seconds.

Your message must be at least 40 characters
Your privacy is guaranteed. Your session will not be used for blog unless you give us persmission.

Click here to get your free Excelchat help session

Subscribe to Excelchat.co
Trusted by people who work at
Amazon.com, Inc
Facebook, Inc
Accenture PLC
Siemens AG
Macy's
The Allstate Corporation
United Parcel Service
Dell Inc