+ Reply to Thread
Results 1 to 7 of 7

Is this an "If Function" formula?

  1. #1
    Registered User
    Join Date
    09-20-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    28

    Is this an "If Function" formula?

    hi all,

    I'm working with a file where there are a range of numbers in one column and I need it to look for that range of numbers and enter a specific text in another column.

    Example

    Column B will contain numbers 50xxxx,55xxxx,70xxxx,90xxxx,92xxxx.
    numbers between 50xxxx-55xxxx require the text "cat"
    Numbers that start with 70xxxx require "dog"
    Numbers between 90xxxx-92xxxx require cat dog.

  2. #2
    Valued Forum Contributor Miraun's Avatar
    Join Date
    04-03-2009
    Location
    New England
    MS-Off Ver
    2003, 2007, 2010, 2013
    Posts
    554

    Re: Is this an "If Function" formula?

    An IF function will work adequately...

    =If B1 <56000,"Cat",If(B1>89999,"Cat Dog","Dog"))

    Assuming there are no values outside of the ones you listed in your example.
    Going for Guru! Click the Star to the bottom left of this post if I helped!

  3. #3
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2504
    Posts
    13,620

    Re: Is this an "If Function" formula?

    Does xxxx represent a numeric or alpha string?

  4. #4
    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: Is this an "If Function" formula?

    Try

    =IF(AND(B1>=50XXXX,B1<=55XXXX),"CAT",IF(AND(B1>=70XXXX,B1<=71000);"DOG",IF(AND(B1>=90XXXX,B1<=92XXXX),"CAT&DOG",""))))
    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.

  5. #5
    Registered User
    Join Date
    09-20-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    28

    Re: Is this an "If Function" formula?

    Quote Originally Posted by Pepe Le Mokko View Post
    Does xxxx represent a numeric or alpha string?
    Numeric and the values vary. Anything between 500000 and 520000 would be one set (dog)

  6. #6
    Registered User
    Join Date
    09-20-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    28

    Re: Is this an "If Function" formula?

    Quote Originally Posted by Fotis1991 View Post
    Try

    =IF(AND(B1>=50XXXX,B1<=55XXXX),"CAT",IF(AND(B1>=70XXXX,B1<=71000);"DOG",IF(AND(B1>=90XXXX,B1<=92XXXX),"CAT&DOG",""))))
    This worked. Thanks!

  7. #7
    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: Is this an "If Function" formula?

    You are welcome.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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