### ERROR.TYPE() Function

This function returns a value corresponding to the type of Excel error. This is the syntax:

ERROR.TYPE(error_val)

error_val is a reference to a cell that has a formula that you want to check if it returns an error value. Here are the possible return values: This function can be very useful to check if a certain formula returns an error, so that you can display a custom error message to the user. For that you can use the IF() function combined with the CHOOSE() function, like this:

=IF(ERROR.TYPE(A2)<=8,CHOOSE(ERROR.TYPE(A2),"Ranges not intersecting","0 Divisor","Wrong data type","Invalid cell reference", "Unrecognized range or function name","Number error","Inappropriate function argument","Waiting for query data"),"")

This formula will check if there is an error on cell A2 formula and if it returns a ERROR.TYPE value will choose the appropriate error message to display on the cell where this formula is placed. If there is no error, it will return nothing. Here are some examples of the use of it: You can improve this formula to give you the cell address where you have the error by using the CELL() function, like this:

=IF(ERROR.TYPE(A3)<=8,CHOOSE(ERROR.TYPE(A3),"Ranges not intersecting","0 Divisor","Wrong data type","Invalid cell reference", "Unrecognized range or function name","Number error","Inappropriate function argument","Waiting for query data")& " on cell " & CELL("address",A3),"")

This will return a message like this instead: Hope this is useful to get your worksheets more user friendly.
{"ft_lang_label":"__label__en","ft_lang_prob":0.6926543,"math_prob":0.8793655,"size":1551,"snap":"2020-34-2020-40","text_gpt3_token_len":340,"char_repetition_ratio":0.13833226,"word_repetition_ratio":0.114035085,"special_character_ratio":0.23339781,"punctuation_ratio":0.14285715,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9788728,"pos_list":[0,1,2,3,4,5,6],"im_url_duplicate_count":[null,9,null,9,null,9,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-08-05T04:47:53Z\",\"WARC-Record-ID\":\"<urn:uuid:09fa1d49-bd71-4631-8ea6-52d273d04fd2>\",\"Content-Length\":\"82478\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:3bdee79a-466a-4701-acbc-4034eb039597>\",\"WARC-Concurrent-To\":\"<urn:uuid:37ac57de-fc6f-49f6-beab-5c293bc6a9c3>\",\"WARC-IP-Address\":\"172.217.13.243\",\"WARC-Target-URI\":\"http://www.excel-user.com/2011/04/errortype-function.html?widgetType=BlogArchive&widgetId=BlogArchive1&action=toggle&dir=open&toggle=MONTHLY-1298937600000&toggleopen=MONTHLY-1301612400000\",\"WARC-Payload-Digest\":\"sha1:47D22BLJEVIBSUABWY346BUA4BYHTAUO\",\"WARC-Block-Digest\":\"sha1:XRJMHV5XSNGAI3PGD266PJIAGBICVT3B\",\"WARC-Identified-Payload-Type\":\"application/xhtml+xml\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-34/CC-MAIN-2020-34_segments_1596439735909.19_warc_CC-MAIN-20200805035535-20200805065535-00182.warc.gz\"}"}