+ Reply to Thread
Results 1 to 5 of 5

Numerical Logic colliding with Text

Hybrid View

  1. #1
    Registered User
    Join Date
    06-29-2007
    Posts
    11

    Numerical Logic colliding with Text

    Sorry if this is answered elsewhere, my rule of thumb is if it doesn't show up in 30 minutes of searching online I've satisfied my karmic duty before posting =).

    I have a monster of a sheet going and am working for research purposes. I dislike the interface of SPSS so I use excel to boil down my variables to a smaller state, to which it then goes back to SPSS for the hardcore analysis.

    Unfortunately, this study has values of "N/A", "Missing", and "." (not entered), so it makes it a bit tricky for me.

    Say I want to check 10 different scales to see if any are true:
    =IF(OR(FJ6>=1,ZD6>=1,....etc),"Yes","No"))

    Problem is the blasted program is reading ".", "Missing", and "N/A" as greater than one!!!!! I've found a way around by making monster formulas that first check that the field is not equal to those three text values, but there must be a faster way!

    To see what I mean, put a period in one cell (like A1) and write =IF(A1>=1,"Yes","No") and you'll see it returns a Yes.

    Do any of you know a function structure for number checking that does NOT include text? Does it have to do with cell formatting?
    Last edited by VBA Noob; 10-13-2008 at 05:12 PM.

  2. #2
    Registered User
    Join Date
    06-29-2007
    Posts
    11
    I'm temporarily working around the issue by making the argument impossible for text... =IF(A1*2>=1,"Yes","No"). When attempting to multiply "Missing" by 2, it returns a #VALUE! error.

    Problem is, my solution is rather crude and will not work in other applications. Also, if I put constraints on the range like =IF(AND(A1>=1,A1<=100),"Yes","No") then text is not counted as a true value. That limits my ability as well.

    Any way to do this simply?

  3. #3
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,702
    You can check to see if the value is numeric, e.g.

    =IF(AND(ISNUMBER(A1+0),A1>=1),"Yes","No")

  4. #4
    Registered User
    Join Date
    06-29-2007
    Posts
    11
    I owe you big time =), thank you.

    I tested it and I'm assuming the + 0 is just an additional optional usage?
    Last edited by Feinam; 10-13-2008 at 05:12 PM.

  5. #5
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,702
    You may not need the +0.

    I included it in case you might have numbers formatted as text, e.g. if you have "5" in A1 but it's text formatted then ISNUMBER(A1) will return FALSE but if you use ISNUMBER(A1+0) the +0 "coerces" text formatted numbers to numeric, so you'd get TRUE

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Find row number of text string in a range of cells
    By Steven Fleck in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-06-2013, 08:38 PM
  2. SUMIF with multiple criteria, text and numerical
    By Radman in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-24-2008, 12:23 PM
  3. Assign text to a numerical range.
    By jaspercoGIS in forum Excel General
    Replies: 2
    Last Post: 01-18-2008, 03:46 PM
  4. Text returning a numerical value
    By slinger1010 in forum Excel General
    Replies: 3
    Last Post: 11-14-2006, 08:24 AM
  5. Can I give text a numerical value?
    By rshane in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 10-27-2006, 01:34 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1