+ Reply to Thread
Results 1 to 9 of 9

Matching values from 2 columns and returning the value in 3rd column

  1. #1
    Registered User
    Join Date
    12-05-2011
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    15

    Matching values from 2 columns and returning the value in 3rd column

    I have been trying to work out this formula for days without any luck. Please see attached file for a better udnerstanding of what I am trying to achieve.

    I need to lookup the value in column a and match this to a value in column b to return the value that appears in column e. For example, i want to know how much time Tim Smith has spent on training creation, then i would need to check a11 and b11 and the value i want the formula to return is e11.

    Please can someone assist with the formula I need to be using?

    Thanks in advance!
    Attached Files Attached Files

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Matching values from 2 columns and returning the value in 3rd column

    Shaz_79,

    Welcome to the forum!
    Attached is a modified version of your workbook. I inserted a few rows above the data so that you can continue adding data to the table. Cell B2 is a data-validation drop drown list containing the Resources ('Smith, Tim' and 'Jones, Alex'). Cell B3 is a data-validation drop down list containing the Task Names for those resources.

    The total is calculated in cell B4 with the following formula:
    =IF(OR(B2="",B3=""),"",SUMPRODUCT(--(A7:A31=B2),--(B7:B31=B3),E7:E31))
    Attached Files Attached Files
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    12-05-2011
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Matching values from 2 columns and returning the value in 3rd column

    Thanks for the swift reply.

    My apologies, but I didn't give the full picture on what I am trying to achieve, so I am still having some problems with the formula.

    I have 2 worksheets in a spreadsheet, the raw data (what you saw previously) and a main worksheet where I am trying to pull certain data into. I have attached the full file now.

    In the 'Main' worksheet in cell e4, is where i want the output of the formula you have written to be presented. How can I do this?

    Eventually my 'Main' file will contain all of the task names that appear in the 'Raw Data' file, so can I easily adapt the formula so that I can output the value per task name and dependant on the resource?

    Thanks!
    Attached Files Attached Files

  4. #4
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Matching values from 2 columns and returning the value in 3rd column

    In the 'Main" worksheet, cell E4, use this formula:
    =SUMPRODUCT(--('Raw Data'!$A$7:$A$31=$C3),--('Raw Data'!$B$7:$B$31=TRIM(MID(E$2,5,LEN(E$2)))),'Raw Data'!$E$7:$E$31)

    Then copy it over as necessary. The formula assumes that the "> ## Task Name" will have a max of 2 numbers in the ## spot. If this is not the case, let me know.

  5. #5
    Registered User
    Join Date
    12-05-2011
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Matching values from 2 columns and returning the value in 3rd column

    Can you possibly show me the working example as when i copy the formula into my spreadsheet, i am getting the value 0.00 returned whereas it should be 0.3

    Thanks

  6. #6
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Matching values from 2 columns and returning the value in 3rd column

    See attached
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    12-05-2011
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Matching values from 2 columns and returning the value in 3rd column

    Hi - So grateful for your help. But I am new to this site, and although I opened your updated file when you first sent it to me, I wasnt able to properly review it. Now, when I click on the link some other data appears in the file. Can you reattach the previous file for me please so that I can see the working example again?

    Thanks!!

  8. #8
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Matching values from 2 columns and returning the value in 3rd column

    Shaz_79,

    Unfortunately, I do not keep example workbooks, I delete them at the end of the day (this is because I am mainly on this forum from my work computer, during times that I am in between assignments). With the recent upgrade to the vBulletin version this forum uses, the attachment database got corrupted. This means that all of the attachments shown in this thread are not what they originally were.

    I was going to use your original attachment to recreate the example, but I am unable to for the above reason. If you could repost it, I would be happy to recreate the example for you.

  9. #9
    Registered User
    Join Date
    12-05-2011
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Matching values from 2 columns and returning the value in 3rd column

    I just saw that you had replied to me, thanks so much.

    I have reattached the file for you now.

    Thanks.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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