+ Reply to Thread
Results 1 to 4 of 4

IF Statement Range

  1. #1
    Registered User
    Join Date
    04-23-2014
    Location
    United Kingdom
    MS-Off Ver
    Excel 2003
    Posts
    2

    IF Statement Range

    I'm looking for advice on how to add a range to an IF statement. I want to compare to cells for instance, A1 and B1; if B1 is within at most -5 (the figure being more than A1 is not a problem) of A1, then cell C1 would return the message GOOD. At the moment I am using the CountIF function;

    =IF(COUNTIF(D1:D100,B1)>0,"GOOD","BAD")

    D1:D100 represents the range;

    =(A1-5), =(A1-4)... =(A1+1)... =(A1+100)...

    And so forth.

    This works when B1 is a static number but within the spreadsheet I am using B1 is calculated by four variable numbers chosen by the user from drop down menus. (data validation)

    B1=100*(F1+F2+F3+F4)/4

    Where the F1:F4, are the variable numbers. For Example F1 could equal 10 or 5 dependant on the drop down choice.

    Using the initial forumula in this manner will only return "BAD" into Cell C1, irrespective of whether B1 is within the determined range.

    Does anybody have an idea how to fix this problem, or a more suitable formula to use? (Possibly a VLOOKUP?)
    Last edited by Mark9; 04-23-2014 at 11:04 AM.

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: IF Statement Range

    Put in C1:
    =IF(B1>=A1-5,"Good","Bad")

    I think?

  3. #3
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,734

    Re: IF Statement Range

    does it show BAD because F1-f4 are blank and so zero
    unless the dropdowns have negative numbers the result can only be good , unless F1-F4 is zero or blank - if its when F1-F4 are blank to start you may have the issue

    then you could just add to your IF to test for blanks
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  4. #4
    Registered User
    Join Date
    04-23-2014
    Location
    United Kingdom
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: IF Statement Range

    Quote Originally Posted by ragulduy View Post
    Put in C1:
    =IF(B1>=A1-5,"Good","Bad")

    I think?
    This works, it would seem I was over complicating the process.

    Thank You.

+ 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] IF statement for range
    By Laudar in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-17-2013, 12:19 PM
  2. [SOLVED] If then statement using range
    By zeroaxs in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-07-2013, 12:21 PM
  3. If statement with a range and true/false statement
    By aarleblanc in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-20-2012, 06:34 PM
  4. If Statement in a Range
    By new@this in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-18-2007, 02:34 PM
  5. IF Statement with a range
    By Phillycheese5 in forum Excel Formulas & Functions
    Replies: 22
    Last Post: 09-06-2005, 06:05 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