Three new functions that should be part of your standard set

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Why aren't these functions built into Excel? It would simplify SOOO many
spreadsheets:

'
' If the value is blank, return the blankvalue,
' otherwise return the value
'
Public Function IfBlank(ByVal value As Variant, ByVal blankValue As Variant)
As Variant
If IsEmpty(value) Or (value = "") Then
IfBlank = blankValue
Else
IfBlank = value
End If
End Function

'
' If the value is valid, return the value, otherwise just return blank
'
Public Function IfValid(ByVal value As Variant) As Variant
If IsError(value) Then
IfValid = ""
Else
IfValid = value
End If
End Function

'
' If the value is in error, return the other value
'
Public Function IfError(ByVal value As Variant, ByVal valueIfError As
Variant) As Variant
If IsError(value) Then
IfError = valueIfError
Else
IfError = value
End If
End Function


----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

http://www.microsoft.com/office/com...dg=microsoft.public.excel.worksheet.functions
 
I don't think I follow. What's wrong with

=IF(value="",blankvalue,value)
=IF(ISERR(value),"",value)
=IF(ISERR(value),valueiferror,value)

Or, in VBA using the IIF function?
 
For instance the IFERROR function works like this

=IFERROR(VLOOKUP(A2,B2:C50,2,0),"")

whereas now you need to use something like

=IF(ISNA(VLOOKUP(A2,B2:C50,2,0)),"",VLOOKUP(A2,B2:C50,2,0))


--

Regards,

Peo Sjoblom

http://nwexcelsolutions.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top