+ Reply to Thread
Results 1 to 8 of 8

Getting data from one sheet to another, depending on two text values

  1. #1
    Registered User
    Join Date
    09-04-2017
    Location
    London, England
    MS-Off Ver
    Microsoft365
    Posts
    9

    Getting data from one sheet to another, depending on two text values

    C3 in Sheet 2 needs to contain the value of G3 in Sheet 1 IF B3 in sheet 1 contains a specific text and C3 in Sheet 1 contains a specific text -

    So for example, If a driver whose name gets entered via drop down in Sheet 1, B3, has an incident, the title of which is entered by drop down in Sheet 1, C3, then the cost of that incident is entered into Sheet 1, G3. The value in Sheet 1 G3, then needs to be entered into Sheet 2, C3.

    Help!

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    Excel 2016 (Win 10 - Work) & 365 Subscription (Win 10 - Home)
    Posts
    30,517

    Re: Getting data from one sheet to another, depending on two text values

    Will you please attach a sample Excel workbook? We are not able to work with or manipulate a description of one and nobody wants to have to recreate your data from scratch.

    1. Make sure that your sample data are REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired solution is also shown (mock up the results manually).

    3. Make sure that all confidential data is removed or replaced with dummy data first (e.g. names, addresses, E-mails, etc.).

    4. Try to avoid using merged cells as they cause lots of problems.

    Unfortunately the attachment icon doesn't work at the moment, so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

    Please pay particular attention to point 2 (above): without an idea of your intended outcomes, it is often very difficult to offer appropriate advice.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!

    Forum Rules (updated September 2018): please read them here.
    How to use the Power Query code you've been given: help here. More about the Power suite here.
    Don't forget to say "thank you" to those who have helped you in your thread. If you wish, you can also reward them by clicking on their reputation star bottom left.

  3. #3
    Registered User
    Join Date
    09-04-2017
    Location
    London, England
    MS-Off Ver
    Microsoft365
    Posts
    9

    Re: Getting data from one sheet to another, depending on two text values

    Apologies - I'm new at these forums. Please find attached a mock up of what I am trying to achieve. Sheet 2 is basically counting the occurrences of certain types of incidents for each person and attributing the total costs of those incidents.
    Attached Files Attached Files

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Northern Ireland
    MS-Off Ver
    Excel 2013 & 2016
    Posts
    21,591

    Re: Getting data from one sheet to another, depending on two text values

    In B3:
    =IF($A3="","",COUNTIFS(Driver!$B:$B,$A3,Driver!$C:$C,B$1))


    In C3:
    =IF($A3="","",SUMIFS(Driver!$G:$G,Driver!$B:$B,$A3,Driver!$C:$C,B$1))

    Select BOTH cells and drag formula across/down as far as needed.
    Attached Files Attached Files
    Glenn



  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Northern Ireland
    MS-Off Ver
    Excel 2013 & 2016
    Posts
    21,591

    Re: Getting data from one sheet to another, depending on two text values

    ... or if you find all those 0s distracting, in B3:

    =IFERROR(1/(1/COUNTIFS(Driver!$B:$B,$A3,Driver!$C:$C,B$1)),"")

    and in c3:

    =IFERROR(1/(1/SUMIFS(Driver!$G:$G,Driver!$B:$B,$A3,Driver!$C:$C,B$1)),"")

    again select both cells and drag...

  6. #6
    Registered User
    Join Date
    09-04-2017
    Location
    London, England
    MS-Off Ver
    Microsoft365
    Posts
    9

    Re: Getting data from one sheet to another, depending on two text values

    Thanks so much for your help - extremely useful!

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Northern Ireland
    MS-Off Ver
    Excel 2013 & 2016
    Posts
    21,591

    Re: Getting data from one sheet to another, depending on two text values

    You're welcome.



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

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.

  8. #8
    Registered User
    Join Date
    09-04-2017
    Location
    London, England
    MS-Off Ver
    Microsoft365
    Posts
    9

    Re: Getting data from one sheet to another, depending on two text values

    In a slight amendment to the original question,I am now looking to add a third instruction to these formulae. So, I want the same thing to happen but ONLY if 'Yes' is selected in Column L, in the sheet named 'Driver'.

    I am sure this must be more simple than I am trying to make it!

+ 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