Solved

Excel: Return Error Statement in Text Formula

Posted on 2014-09-09
8
114 Views
Last Modified: 2014-09-14
Hi,

A1 = #Value!
A2 = Test

I would like A3 to display: "#Value! Test"

I enter the formula: "=A1&" "&A2" however it returns just the value error. How can I get the formula to return the text and the error?

Cheers,
0
Comment
Question by:dabug80
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 50

Expert Comment

by:Rgonzo1971
ID: 40313739
Hi,

pls try if you only want the value error to show

=IF(ISERROR(ERROR.TYPE(A1)=3);A1;"#VALUE!")&" "&a2

if not maybe better a User Defined Function like

Function fShowError(rng As Range) As Variant

Set R = rng.Resize(1, 1)
If IsError(R.Value) = True Then
    If R.Value = CVErr(xlErrValue) Then
        Res = "#VALUE!"
    Else
        Res = "Another error"
    End If
Else
    Res = R.Value
End If
fShowError = Res

End Function

Regards
0
 
LVL 19

Expert Comment

by:helpfinder
ID: 40313748
in A3 use
=the same formula as you have in A1&" "&A2
0
 
LVL 50

Expert Comment

by:Rgonzo1971
ID: 40313754
my New Version

=IFERROR(CHOOSE(ERROR.TYPE(A3),"#NULL!","#DIV/0!","#VALUE!","#REF!","#NAME?","#NUM!","#N/A"),A1)&" "&A2
Regards
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

 
LVL 1

Author Comment

by:dabug80
ID: 40313854
Hi Rgonzo,

Sady that didn't work
0
 
LVL 50

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 40313884
See example
EDIT Corrected Formula

=IFERROR(CHOOSE(ERROR.TYPE(A1),"#NULL!","#DIV/0!","#VALUE!","#REF!","#NAME?","#NUM!","#N/A"),A1)&" "&A2
EE20140910.xlsm
0
 
LVL 33

Expert Comment

by:Rob Henson
ID: 40314345
As soon as you refer to a cell whose calculated result is an error, the result of the reference to that cell will also be the same error.

Therefore, the following should work:

=IFERROR(A1,"#Value! "&A2)

Extending the question, what do you want in A3 if A1 is not an error?

Thanks,
Rob H
0
 
LVL 33

Expert Comment

by:Rob Henson
ID: 40314371
Ahhh, just re-read the solution from RGonzo and I realise now he has forced the behaviour of the statement in my previous comment, (refer to error = same error) and pulled in the same text value as the error result. Nice one!!

If you want text the same as the error result then that is the way to go. If you want "#Value!" for all errors then mine will suffice.

Thanks
Rob H
0
 
LVL 1

Author Closing Comment

by:dabug80
ID: 40322279
Excellent. Thanks for your help
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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…
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa‚Ķ

830 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