Solved

ERROR.TYPE  and Choose alternative solution

Posted on 2014-10-13
8
113 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 49

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 32

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 32

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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 49

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 49

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Drop Down List with Unique/Distinct Values (enhancing the Combo-Box with a few steps and a little code) David miller (dlmille) Intro Have you ever created a data validation list from a database field or spreadsheet column (e.g., Zip Codes or Co…
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…
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

910 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

18 Experts available now in Live!

Get 1:1 Help Now