+ Reply to Thread
Results 1 to 17 of 17

Select Based on 2 search criteria

Hybrid View

  1. #1
    Registered User
    Join Date
    05-20-2009
    Location
    New York City, USA
    MS-Off Ver
    Excel 2003
    Posts
    9

    Select Based on 2 search criteria

    Hello,

    I have an Excel Sheet with three columns of data. In a separate worksheet, I am setting up some calculations. To do so, I am having the user select from a drop down list, the data in the first and second columns. Based on the two values selected by the user, I would like to bring forward the value in the third column. Can someone please help me out with the formula to do so?

    Thanks in advance
    Last edited by Tony Itwaru; 05-20-2009 at 05:10 PM. Reason: NBVC IS AWESOME.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Select Based on 2 search criteria

    Can you tell us all the appropriate ranges and references needed to be referenced and what kind of values are contained in the "third column"
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    05-20-2009
    Location
    New York City, USA
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Select Based on 2 search criteria

    Column A has a numerical value from rows A1 thru A197. Similarly column B and C has a value between rows 1 thru 197. The following is an example ...

    Col A Col B Col C
    01 8835 0.97
    22 8835 1.00
    75 8801 1.17
    76 8825 0.80


    Thanks in advance.

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Select Based on 2 search criteria

    So let's assume that the range you specked is in Sheet2!A2:C5 and your inputs are in Sheet1!A1 and B1

    in Sheet1!C1 enter formula:

    =Sumproduct(--('Sheet2'!$A$2:$A$5=A1),--('Sheet2'!$B$2:$B$5=B1),$C$2:$C5)

    This is based on the assumption that the column A and B combinations in Sheet2 are unique....

  5. #5
    Registered User
    Join Date
    05-20-2009
    Location
    New York City, USA
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Select Based on 2 search criteria

    NBVC,

    I can't seem to get it work.

    The following is the formula I am using.

    =SUMPRODUCT(--(Sheet3!$A$3:$A$197='RATING WORKSHEET'!C9),--(Sheet3!$B$3:$B$197='RATING WORKSHEET'!$E$10:$F$10),Sheet3!$C$3:$C$197)

    I am getting a #VALUE message in the destination cell.

    Can you please tell me what I might be doing wrong.

    Thanks again.

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Select Based on 2 search criteria

    Is 'RATING WORKSHEET'!$E$10:$F$10 a merged cell?

    Try:

    =SUMPRODUCT(--(Sheet3!$A$3:$A$197='RATING WORKSHEET'!C9),--(Sheet3!$B$3:$B$197='RATING WORKSHEET'!$E$10),Sheet3!$C$3:$C$197)

  7. #7
    Registered User
    Join Date
    05-20-2009
    Location
    New York City, USA
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Select Based on 2 search criteria

    Yes, the Rating Worksheet cell was a merged cell. I've 'unmerged' it to see if that would resolve the issue. It did not. I am now getting 0.00 for any combination that I select.

    Thank You.

  8. #8
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Select Based on 2 search criteria

    Did you also replace the formula with my new one?

    If no good still, possible to post a sample worksheet?

  9. #9
    Registered User
    Join Date
    05-20-2009
    Location
    New York City, USA
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Select Based on 2 search criteria

    Correction ....

    It seems that if the value in the third column is above 1.00, it is selected. However, if the value is under 1.00, it displays 0.00.

  10. #10
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Select Based on 2 search criteria

    How is your cell formatted?

  11. #11
    Registered User
    Join Date
    05-20-2009
    Location
    New York City, USA
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Select Based on 2 search criteria

    cell is formatted as number with 2 decimal places. I can upload the actual worksheet as soon as I figure out how to do that. I am a newbie ... sorry.

  12. #12
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Select Based on 2 search criteria

    Okay, we are posting over each other

    It looks like your input cells are text entries while the lookup range in Sheet3 are numeric, formatted to look like text...

    so try this formula now:

    =SUMPRODUCT(--(Sheet3!$A$3:$A$197='RATING WORKSHEET'!C9+0),--(Sheet3!$B$3:$B$197='RATING WORKSHEET'!$E$10+0),Sheet3!$C$3:$C$197)
    the +0 converts text to number.

  13. #13
    Registered User
    Join Date
    05-20-2009
    Location
    New York City, USA
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Select Based on 2 search criteria

    File is attached.
    Attached Files Attached Files

  14. #14
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Select Based on 2 search criteria

    When you click Post Reply look for the paperclip icon at the top of the Reply box.. then browse for and upload your file....

    ...unfortunately I am about to logout... so if you can have it back in minutes..then I will look at, otherwise, someone else may help or wait till I log back in later or tomorrow.

  15. #15
    Registered User
    Join Date
    05-20-2009
    Location
    New York City, USA
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Select Based on 2 search criteria

    I attached the file already.

    Thanks again.

  16. #16
    Registered User
    Join Date
    05-20-2009
    Location
    New York City, USA
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Select Based on 2 search criteria

    Awesome ... Looks like it works great...

    Thanks.

  17. #17
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Select Based on 2 search criteria

    Great.. Now I can sleep tonight

    Please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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