+ Reply to Thread
Results 1 to 7 of 7

return cell in row based on two criteria

  1. #1
    Registered User
    Join Date
    12-06-2012
    Location
    London
    MS-Off Ver
    Excel 2016
    Posts
    9

    return cell in row based on two criteria

    Hey Guys,

    I need to find the first row in a table that matches a value when two criteria are met. I've attached a super simple spreadsheet, probably a very easy formula for you guys but a bit tricky for me!

    Thanks in advance.

    Matt
    Attached Files Attached Files
    Last edited by mattzkn; 03-01-2020 at 09:16 AM. Reason: typo

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,898

    Re: return cell in row based on two criteria

    Are you still using Excel 2007? If not, please update your user profile. Thanks.

    Your expected results are not all correct:

    =MIN(IF($B$2:$B$13=G2,IF($C$2:$C$13>0,$D$2:$D$13)))

    ... entered using CTRL+SHIFT+ENTER (not just ENTER).
    Last edited by AliGW; 03-01-2020 at 09:32 AM.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Valued Forum Contributor
    Join Date
    04-01-2015
    Location
    The Netherlands
    MS-Off Ver
    2003/2007/2010/2016/office 365
    Posts
    880

    Re: return cell in row based on two criteria

    or
    =MIN(IF(($B$2:$B$13=G2)*($C$2:$C$13>0),$D$2:$D$13))
    Close te formula with CSE

  4. #4
    Registered User
    Join Date
    12-06-2012
    Location
    London
    MS-Off Ver
    Excel 2016
    Posts
    9

    Re: return cell in row based on two criteria

    That works perfectly!

    Unfortunately i've realised there is one more criteria to be met. I've added this in a new column and tried stacking another IF into your equation but couldn't get it to work.

    I've attached the updated spreadsheet, could you take a look and see if you can get it to work with one more criteria (type must be "buy")
    Attached Files Attached Files

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,898

    Re: return cell in row based on two criteria

    Either this:

    =MIN(IF($B$2:$B$13=H2,IF($C$2:$C$13="buy",IF($D$2:$D$13>0,$E$2:$E$13))))

    or this:

    =MIN(IF(($B$2:$B$13=H2)*($C$2:$C$13="buy")*($D$2:$D$13>0),$E$2:$E$13))

  6. #6
    Registered User
    Join Date
    12-06-2012
    Location
    London
    MS-Off Ver
    Excel 2016
    Posts
    9

    Re: return cell in row based on two criteria

    Great, thanks

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,898

    Re: return cell in row based on two criteria

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

+ 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 formula return a value based on criteria in a cell
    By lucipurr in forum Excel General
    Replies: 2
    Last Post: 02-01-2019, 10:41 AM
  2. [SOLVED] how to return a value based on other cell criteria
    By deanblew in forum Excel General
    Replies: 5
    Last Post: 08-11-2017, 05:01 AM
  3. [SOLVED] Return the value of a cell based on 4 criteria
    By rossi_69 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 04-24-2015, 03:03 PM
  4. How to return a blank cell based on if then criteria
    By azucar360 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-01-2013, 04:05 PM
  5. Return Cell Value based on Multiple Criteria
    By StuartO in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-13-2013, 06:56 AM
  6. [SOLVED] Return cell value based on criteria of 2 columns
    By Fatnslow in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-03-2012, 04:52 AM
  7. return cell references based on criteria
    By blakeyoung in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-22-2008, 09:10 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