+ Reply to Thread
Results 1 to 7 of 7

Find a specific value in a cell (numerics)

  1. #1
    Registered User
    Join Date
    05-27-2014
    MS-Off Ver
    2013
    Posts
    21

    Find a specific value in a cell (numerics)

    I am trying to check some data (about 5000 rows worth) and don't want to have to go through each row. What I need to do is check whether the 7th number in a string is below 5, and then to return a text result for above 5 and a different result for below 5. For example:

    B4: 88050170088
    7th value = 7, therefore return "Male"

    I have tried =IF(MID(B4,7,1)>5,"Female","Male") but it is not working and I can't figure out why..could also just be making a rookie mistake....

  2. #2
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: Find a specific value in a cell (numerics)

    This is because MID(B4,7,1) returns a number as text and you are comparing it with a pure number.
    So try either of these...

    Please Login or Register  to view this content.
    Or

    Please Login or Register  to view this content.
    Any mathematical operation on a number stored as text converts it back to a number.
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  3. #3
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Find a specific value in a cell (numerics)

    What do you mean saying "is not working"?

    Your formula in your example gives a "Female" as result which is correct when B4 is a number.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  4. #4
    Registered User
    Join Date
    05-27-2014
    MS-Off Ver
    2013
    Posts
    21

    Re: Find a specific value in a cell (numerics)

    Thanks very much - makes sense now

  5. #5
    Registered User
    Join Date
    05-27-2014
    MS-Off Ver
    2013
    Posts
    21

    Re: Find a specific value in a cell (numerics)

    The formula was only returning one result - but I have come right with the above formula suggestions because I wasn't taking all factors into account

    Thanks for the kind assistance all

  6. #6
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: Find a specific value in a cell (numerics)

    You're welcome. Thanks for the feedback.
    If that takes care of your question, please mark your thread as Solved by selecting Thread Tools (just above your first post) --> Mark thread as solved.

  7. #7
    Registered User
    Join Date
    06-20-2014
    Location
    India
    MS-Off Ver
    2013
    Posts
    22

    Re: Find a specific value in a cell (numerics)

    Just replace the words Male and female..
    Because the condition is that if the value at 7th Position is greater than 7, then it should result as male. try this;

    =IF(MID(B4,7,1)>5,"Male","Female")


    Regards,
    Vikaskamble87

+ 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. Use a specific cell reference to find and overwrite that row(Find and Copy).
    By Abbadon486 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-16-2014, 11:57 AM
  2. Extracting only numerics to next cell
    By puttu in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-16-2013, 04:22 PM
  3. Replies: 2
    Last Post: 08-05-2013, 07:32 PM
  4. Copying a cell with Alpha & Numerics
    By sarah1 in forum Excel General
    Replies: 3
    Last Post: 09-09-2010, 05:24 PM
  5. Replies: 3
    Last Post: 04-22-2010, 04:11 AM

Tags for this Thread

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