+ Reply to Thread
Results 1 to 5 of 5

IF cell equals cell range question

  1. #1
    Forum Contributor
    Join Date
    04-02-2012
    Location
    Ohio
    MS-Off Ver
    Excel 2010
    Posts
    452

    IF cell equals cell range question

    Roullete betting strategy sample.xlsx

    I am having a lot of trouble finding the answer to my problem. What I want to do in simple terms is say "if the number in this specific cell is found in this array of cells, return this text, if not then return this other text".

    In more complicated and thorough terms I want to say if Spins G3 cell number is found in Bets M1:N19 (or M1:M38 if it makes it easier), display the text WIN, if not then return the text LOSE.

    While I would appreciate an formula that works, I would really appreciate an explanation of how it works, as I have searched multiple options and tried them and end up with value or na or other errors that prevent the formula from working correctly. Thank you.

  2. #2
    Forum Expert RobertMika's Avatar
    Join Date
    06-22-2009
    Location
    Haverhill, UK
    MS-Off Ver
    Excel 2003-13
    Posts
    1,530

    Re: IF cell equals cell range question

    Is this to be found on Spins or bets.
    You have two formulas(3 actually) pointing to different sheets,Besides Bets M1:n19 are empty.
    If you are http://www.excelforum.com/image.php?type=sigpic&userid=125481&dateline=1392355029happy with the results, please add to the contributor's
    reputation by clicking the reputation icon (star icon).




    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.
    To undo, select Thread Tools-> Mark thread as Unsolved.
    http://www.excelaris.co.uk

  3. #3
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: IF cell equals cell range question

    hi there. you can't have more than 1 separate formulas in a single cell like in G3:
    =IF(Bets!M1:Bets!N19=G2, "Win", "Lose")
    =IF(Spins!M1:N19=Spins!G2,"WIN","LOSE")
    =IF(COUNTIF(B1:B29, 4) >0, "YES", "NO")

    i'm taking the 1st one since that's what you described. 2nd thing. i suppose your quote below means Spins G2?
    if Spins G3 cell number is found in Bets M1:N19
    G3 is the cell with the formula.

    3rd thing. if you compare a single cell with another single cell, you get a single result right? for eg.
    =IF(Bets!M1=G2, "Win", "Lose")
    but if you compare a range with a single cell, you are going to get multiple results that compares Bets!M1 with G2, Bets!M2 with G2, Bets!M3 with G2, and so on...
    Excel won't know which result do you want. so use COUNTIF instead
    =IF(COUNTIF(Bets!$M$2:$N$19,G2)>0,"Win","Lose")

    COUNTIF will count how many times G2 appeared in M2:N19. so if that number is more than 0, label as "Win". otherwise, "Lose".

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  4. #4
    Forum Contributor
    Join Date
    04-02-2012
    Location
    Ohio
    MS-Off Ver
    Excel 2010
    Posts
    452

    Re: IF cell equals cell range question

    The formula is on Spins, specifically Spins G3. M1:N19 is blank because I cleared it prior to saving and uploading just to ensure I didn't have anything in those cells that would throw off the formula.

  5. #5
    Forum Contributor
    Join Date
    04-02-2012
    Location
    Ohio
    MS-Off Ver
    Excel 2010
    Posts
    452

    Re: IF cell equals cell range question

    Quote Originally Posted by benishiryo View Post
    Excel won't know which result do you want. so use COUNTIF instead
    =IF(COUNTIF(Bets!$M$2:$N$19,G2)>0,"Win","Lose")

    COUNTIF will count how many times G2 appeared in M2:N19. so if that number is more than 0, label as "Win". otherwise, "Lose".
    I tried a IF formula which nested a COUNT formula and it didn't work, however this formula does work. Thank you. I will analyze your full answer later on. Thanks.

+ 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. IF cell range B2:M2 equals X then equal same as cell B1
    By tsul5693 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-14-2013, 01:36 AM
  2. Changing Cell Formating if a cell value equals value from a range.
    By radionut in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-31-2013, 01:12 AM
  3. Replies: 2
    Last Post: 03-24-2013, 10:58 PM
  4. If 1 cell equals another in a range than equal to a 3rd cell
    By owenandy in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-22-2012, 10:00 PM
  5. Excel 2007 : If cell equals data question
    By enhydra in forum Excel General
    Replies: 2
    Last Post: 12-26-2009, 04:41 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