?
Solved

Excel: Return Error Statement in Text Formula

Posted on 2014-09-09
8
Medium Priority
?
119 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 52

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 52

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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:dabug80
ID: 40313854
Hi Rgonzo,

Sady that didn't work
0
 
LVL 52

Accepted Solution

by:
Rgonzo1971 earned 2000 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
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‚Ķ

764 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