Formulas or not ??

  • Thread starter Thread starter Brian Ferris
  • Start date Start date
B

Brian Ferris

Good morning guys,

I woant a formula which when referring to another cell
verifies whether this cell contains a numerical value or
otherwise a normal numerical number

Is this possible ?

Thanks in dvance,
Brian
 
Hi Brian,
I woant a formula which when referring to another cell
verifies whether this cell contains a numerical value or
otherwise a normal numerical number

=IF(ISNUMBER(A1),"A1 contains a number","A1 Does not contain a number")

Regards,

Jan Karel Pieterse
Excel MVP
www.jkp-ads.com
 
Hi Brian!

I'm not sure whether I'm interpreting you correctly.

If a number is entered as text (eg by preceeding with an apostrophe) then

=ISNUMBER(A1)
will return FALSE

But:
=ISNUMBER(--A1)
will return TRUE

However, if A1 is an empty cell, then ISNUMBER(--A1) will return TRUE which
may not be what you want.

So for testing, you might use something like:

=IF(ISNUMBER(A1),"A number",IF(ISBLANK(A1),"Blank",IF(ISNUMBER(--A1),"Text
Number","Text")))

--
--
Regards
Norman Harker MVP (Excel)
Sydney, Australia
(e-mail address removed)
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.
 
Hi Brian!

If you are wanting to test whether a cell contains a formula you can use the
User Defined Function:

Function ISFORMULA(MyCell As Range) As Boolean
ISFORMULA = MyCell.HasFormula
End Function

--
--
Regards
Norman Harker MVP (Excel)
Sydney, Australia
(e-mail address removed)
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.
 
But what i mean is ...

if in a particular cell, there is a valid number but which
is a result of another formula, I want it to return false
and not true... I want tru to show ONLY for manually input
variables and not for formulas returning a number..

Hope I made myself clear

Thanks again,
Brian
 
Thanks for the suggestion...

Please guide me as to where I should place this
function... I am green to Visual Basic

Your help will be appreiated.

Thanks,
Brian
 
Since you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Short course:
Open your workbook
Hit alt-f11 to get to the VBE (where macros/UDF's live)
hit ctrl-R to view the project explorer
Find your workbook.
should look like: VBAProject (yourfilename.xls)

right click on the project name
Insert, then Module
You should see the code window pop up on the right hand side

Paste the code in there.

Now go back to excel and test it out.
 

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