+ Reply to Thread
Results 1 to 9 of 9

If Statements and Ranges - Help!

  1. #1
    Registered User
    Join Date
    01-20-2016
    Location
    Warwickshire
    MS-Off Ver
    MS Excel 2010
    Posts
    1

    If Statements and Ranges - Help!

    I would like to merge the following formula so that if a value is entered into a cell in the following cell a letter will be returned depending on the value that was entered In the first cell.

    The ranges I’m looking to use which will drive the letter returned are:
    0-3 = A
    3-7 = B
    7-10 = C
    10 + = D

    I have the below formula which is currently calculating this using 4 different formulas over 4 different cells;
    IF(AND(A1>=1,A1<=3),"A",0)
    IF(AND(A1>=4,A1<=6),"B",0)
    IF(AND(A1>=7,A1<=9),"C",0)
    IF(A1>=10,"D",0)

    If the above formula can be merged if you can let me know how then that would be great. Alternately if you know another way of doing this that would also be great.

    Thanks!

  2. #2
    Valued Forum Contributor
    Join Date
    10-13-2010
    Location
    Sunderland, England
    MS-Off Ver
    Excel 2007 (Home) / 2003 (Work)
    Posts
    740

    Re: If Statements and Ranges - Help!

    =if(a1<=3,"a", if(a1<=6,"b", if(a1<=9,"c","d")))

  3. #3
    Forum Contributor
    Join Date
    02-07-2013
    Location
    Karachi, Pakistan
    MS-Off Ver
    Excel 2007
    Posts
    290

    Re: If Statements and Ranges - Help!

    Hi abbiegards92

    Another option could be:
    =LOOKUP(A1,{0,3,6,10},{"a","b","c","d"})

    Blessing

  4. #4
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: If Statements and Ranges - Help!

    Hi Khalid It should be as below perhaps

    =LOOKUP(A1,{1,4,7,10},{"a","b","c","d"})

    Quote Originally Posted by Khalidngo View Post
    Hi abbiegards92

    Another option could be:
    =LOOKUP(A1,{0,3,6,10},{"a","b","c","d"})

    Blessing
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  5. #5
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,498

    Re: If Statements and Ranges - Help!

    I would use a lookup function like this one... =LOOKUP(A1,{0,1,4,7,10},{"0","A","B","C","D"})
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  6. #6
    Forum Contributor
    Join Date
    02-07-2013
    Location
    Karachi, Pakistan
    MS-Off Ver
    Excel 2007
    Posts
    290

    Re: If Statements and Ranges - Help!

    Quote Originally Posted by shukla.ankur281190 View Post
    Hi Khalid It should be as below perhaps

    =LOOKUP(A1,{1,4,7,10},{"a","b","c","d"})
    Hi Ankur, Oops I overlooked in hurry, yes you are right.

    criteria:
    0-3 = A
    3-7 = B
    7-10 = C

    but it should be something like:
    0-3 = A
    4-7 = B
    8-10 = C

    since we have to include 0-3 for "A"
    =LOOKUP(A1,{0,4,7,10},{"a","b","c","d"})

    Regards,

  7. #7
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,498

    Re: If Statements and Ranges - Help!

    this is a lot of overrkill, but first, I based my first post (#5) on the formulas in post #1 and not the narrative, for the narrative I'd change mine to this...
    =LOOKUP(A1,{0,4,7,10},{"A","B","C","D"}), now if you like if statements yours can be condensed to this... =IFERROR(IF(A1<4,"A",IF(A1<7,"B",IF(A1<10,"C","D"))),0)
    Last edited by Sam Capricci; 01-20-2016 at 10:54 AM.

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,419

    Re: If Statements and Ranges - Help!

    I like the LOOKUP options but, just for fun:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    but this only works if the break points are multiples of three (3).

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  9. #9
    Forum Contributor
    Join Date
    02-07-2013
    Location
    Karachi, Pakistan
    MS-Off Ver
    Excel 2007
    Posts
    290

    Re: If Statements and Ranges - Help!

    Quote Originally Posted by TMS View Post
    I like the LOOKUP options but, just for fun:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    but this only works if the break points are multiples of three (3).

    Regards, TMS
    Hi TMS,
    Nice way of CHOOSE...

    Here is one more (no restriction) :
    =CHOOSE(MATCH(A1,{0,4,7,10},1),"a","b","c","d")

    Blessing

+ 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. [SOLVED] Date Ranges and IF statements
    By mphillips in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-30-2015, 12:42 PM
  2. Help with nested if statements for various ranges
    By ab585 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 02-17-2013, 01:12 AM
  3. Cell ranges and IF statements
    By stefan82 in forum Excel General
    Replies: 4
    Last Post: 04-24-2012, 07:00 PM
  4. Replies: 2
    Last Post: 02-08-2012, 10:51 PM
  5. If statements for ranges
    By garopro in forum Excel General
    Replies: 11
    Last Post: 09-29-2011, 11:33 AM
  6. Multiple If then Statements with ranges
    By cs1014 in forum Excel General
    Replies: 2
    Last Post: 07-29-2009, 12:21 PM
  7. IF statements and ranges
    By Idz21 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-22-2006, 05:22 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