Home > Forum Home > Excel Multiple Regression Analysis and Forecasting Template > Run-Time Error '13' Type Mismatch Share

Run-Time Error '13' Type Mismatch

Excel Help for Run-time Error '13' Type Mismatch in Excel Multiple Regression Analysis and Forecasting Template


Forum TopicPost Reply Login

Run-time Error '13' Type Mismatch

Rate this:
(2.2/5 from 4 votes)
ConfusedI read the previous post in the forum to check data type when this occurs. All of the data is clearly numerical and should not be the problem. I am working with about 14,000 observarations and keep getting this error. Is it because there are to many observations? There is no difference in the number of observations per variable so this is also not the problem. Please let me know how to fix this.
 Posted by on
 
Replies - Displaying 1 to 10 of 13Order Replies By: Most Recent | Chronological | Highest Rated
Oops
Rate this:
(3/5 from 1 vote)
The type mismatch error is normally due to copied data being formatted as text rather than numbers.  This can happen for a number of reasons; however there are some solutions. 

The simplest solution is to do a find and replace (CTRL+H) on apostrophies (i.e. ') for nothing.  Otherwise one can import data using the Data >> Import External Data function from the Excel menu to ensure that values arte imported in numeric format.
 Excel Business Forums Administrator
 Posted by on
Confused
Rate this:
(3/5 from 1 vote)
I am getting this error in a small batch of data (six independent variables, one dependent, sample size of 4), even though I have entered the data by hand as numbers.  I have tried confirming that the data in all cells is in number format by highlighting, then bringing up 'format cells' and formatting all as 'numbers.'  Nothing was copied and pasted. 

Any ideas?  Could it relate somehow to the small sample size?
 Steve
 Posted by on
Oops
Rate this:
(3/5 from 1 vote)
You can send through your template with data by replying to the notification email of this post and attaching the file so that we can investigate the cause of this error.
 Excel Business Forums Administrator
 Posted by on
Confused
Rate this:
(3/5 from 1 vote)
I am also getting a Run-Time Error '13' Type Mismatch in my code. I wrote a code that swops a name into reverse Like accounts to untsacco. When do for one cell the code works perfectly but I need to select a range from A1:A200.

When I do that thats when i get the mismatch Error, Please assist, here is my code

Sub Macro1()
Dim strPassword, Part1, Part2, Part3 As String
Dim xPos As String
Dim xLen As Integer

'
Range("A1").Select

strPassword = Range("A1").Value

xLen = Len(strPassword)

xPos = xLen / 2

If xLen Mod 2 <> 1 Then
Part1 = Mid(strPassword, xPos + 1, xPos)
Part2 = ""
Part3 = Mid(strPassword, 1, xPos)
Else
Part1 = Mid(strPassword, xPos + 2, xPos)
Part2 = Mid(strPassword, xPos + 1, 1)
Part3 = Mid(strPassword, 1, xPos)
End If

outstring = Part1 + Part2 + Part3

Range("D1") = outstring



End Sub
 
 Posted by on
Confused
Rate this:
(3/5 from 1 vote)
Your code expects to find only strings (i.e. Text) in each cell.  You will get a "Run-time error '13' Type Mismatch" if any of the cells are either formatted differently (e.g. a number) or are empty.

If I were you, I would define your target cell as Variant then check to see if it is actually a string in the cell before doing the transform.
 Excel Business Forums Administrator
 Posted by on
Confused
Rate this:
(3/5 from 1 vote)
Hi,
I get this message too. I have tried adjusting the text / number format. I have tried copying and manually inputting the data. I have tried using just a few data values, and all of them (approx. 200) but to no avail. When I click run regression the computer takes ages to determine the run time message, and when I click end, it has changed the number of observations from its original value to 59997 after having put 0's in all the rows beyond the data.
I can't understand why this might be happening. Please help.
Thanks,
Jack
 Posted by on
Oops
Rate this:
(3/5 from 1 vote)
In this case, the program has attempted to correct non numerical or empty input cells.  If it has added zeros below the input data, then it has encountered a problem locating the input data.  Have you added rows or columns within the Input sheet?
 Excel Business Forums Administrator
 Posted by on
Fedup
Rate this:
(3/5 from 1 vote)
Hi,
Thanks for your help. No I haven't added columns or rows into the spreadsheet, just input the data. I have redownloaded the spreadsheet to check that I hadn't done it previously, and this is still the case.
 Any more ideas?
Thanks.
 Posted by on
OopsAfter some testing, we came across a similar error when one or more independent variables have no data.  If titles are entered for independent variables, the program assumes that data exists beneath it. It then attempts look for empty or non-numeric input to exclude before running the analysis.  Since no data exists, it continues this process all the way to the last row of the worksheet.

We have updated the download version to check for missing variable data in order to resolve this issue.


 Excel Business Forums Administrator
 Posted by on
Confused
Rate this:
(3/5 from 1 vote)
Thanks. I'm not sure what solved it, as I downloaded the new version first, but I think it may have been as simple as that I was deleting the data in the third example column, but not the title for it.
 Thanks again.
 Posted by on
 Displaying page 1 of 2 

Find relevant Excel templates and add-ins for Run-Time Error '13' Type Mismatch in the