Solved

Excel: Return Error Statement in Text Formula

Posted on 2014-09-09
8
108 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 48

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 48

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

Author Comment

by:dabug80
ID: 40313854
Hi Rgonzo,

Sady that didn't work
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 48

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 31

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 31

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Drop Down List with Unique/Distinct Values (Part II - ComboBox or ListBox and Data Validation List Bonus!) David Miller (dlmille) Intro This article focuses on delivering unique, sorted lists to list objects (e.g., ComboBox, ListBox) and Dat…
Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
Viewers will learn the basics of slicers and timelines for both PivotTables and standard Excel tables in Excel 2013.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

707 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

16 Experts available now in Live!

Get 1:1 Help Now