Solved

ERROR.TYPE  and Choose alternative solution

Posted on 2014-10-13
8
118 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 50

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 33

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 33

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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
LVL 26

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
 
LVL 50

Expert Comment

by:Rgonzo1971
ID: 40377153
Hi,

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

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 50

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 26

Author Closing Comment

by:ProfessorJimJam
ID: 40377687
Thank you both.

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

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction This Article is a follow-up to my Mappit! Addin Article (http://www.experts-exchange.com/A_2613.html), it was inspired by an email posting I made to EUSPRIG (http://www.eusprig.org/index.htm), I will briefly cover: 1) An overvie…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

820 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