Solved

ERROR.TYPE  and Choose alternative solution

Posted on 2014-10-13
8
109 Views
Last Modified: 2014-10-13
Excelers,

please see attached file. with help of Rgonzo1971. i have the formula combined with choose to tell the users more meaningful explanation of errors in cells.

now, the end users of my excel files are novice excel users and too long formula confuses them, i wanted somehow to convert replacing it with a simple UDF that would be shorter to be used in formulas.

thanks.
ERROR.TYPE.xlsx
0
Comment
Question by:ProfessorJimJam
  • 3
  • 3
  • 2
8 Comments
 
LVL 48

Expert Comment

by:Rgonzo1971
ID: 40377069
Hi,

pls try

Function myFunc(frml As String) As String
myFunc = Evaluate("IFERROR(" & frml & ",CHOOSE(ERROR.TYPE(" & frml & "),""No Intersection"",""Divided by Zero"",""Invalid operand Or Argument type"",""Cell reference Deleted"",""Name Deleted Or Incorrect Name"",""Invalid numeric values Or number is too big"",""Not Available Or No Answer""))")

End Function

in Excel =myFunc("25/0")

Regards
0
 
LVL 31

Expert Comment

by:Rob Henson
ID: 40377077
Would your users understand a lookup table instead?

Rather than using CHOOSE within the formula, maybe you could do a lookup for the error type.
0
 
LVL 31

Accepted Solution

by:
Rob Henson earned 170 total points
ID: 40377096
You would then have the following in a table:

1      No Intersection
2      Divided by Zero
3      Invalid operand Or Argument type
4      Cell reference Deleted
5      Name Deleted Or Incorrect Name
6      Invalid numeric values Or number is too big
7      Not Available Or No Answer

and a formula:

=VLOOKUP(ERROR.TYPE(C1),$A$11:$B$17,2,FALSE)

A11:B17 referring to table above.

Thanks,
Rob H
0
 
LVL 25

Author Comment

by:ProfessorJimJam
ID: 40377114
thank you Rgonzo1971

it gives #Value Error.  does not work.


besides

the vba line is all in one long line, can it be wrapped in different lines like the VBA continuation symbol _
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 48

Expert Comment

by:Rgonzo1971
ID: 40377153
Hi,

see example in A9
ERROR.TYPEv1.xlsm
0
 
LVL 25

Author Comment

by:ProfessorJimJam
ID: 40377181
Rgonzo1971

please see attached.  you used it by putting a string in double quote, i need to give it a cell reference, please see attached. the UDF does not work.
ERROR.TYPEv1.xlsm
0
 
LVL 48

Assisted Solution

by:Rgonzo1971
Rgonzo1971 earned 330 total points
ID: 40377435
Hi,

then try

Function myFunc(rng As Range) As String
myFunc = Evaluate("IFERROR(" & rng.Address & ",CHOOSE(ERROR.TYPE(" & rng.Address & _
    "),""No Intersection"",""Divided by Zero"",""Invalid operand Or Argument type"",""Cell reference Deleted"",""Name Deleted Or Incorrect Name"",""Invalid numeric values Or number is too big"",""Not Available Or No Answer""))")

End Function

Regards
ERROR.TYPEv2.xlsm
0
 
LVL 25

Author Closing Comment

by:ProfessorJimJam
ID: 40377687
Thank you both.

i also liked the idea of Vlookup from Rob too.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
Viewers will learn the basics of slicers and timelines for both PivotTables and standard Excel tables in Excel 2013.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now