+ Reply to Thread
Results 1 to 9 of 9

How to search multiple columns on seperate sheets for more than one criteria

  1. #1
    Registered User
    Join Date
    11-14-2013
    Location
    Dubai
    MS-Off Ver
    Excel 2010
    Posts
    24

    How to search multiple columns on seperate sheets for more than one criteria

    Sheet 1
    Sender Name TransactionDate Net
    Sender A 10/07/2013 22:38 42.5
    Sender B 11/08/2013 19:46 112.5
    Sender C 11/08/2013 19:46 32
    Sender D 11/08/2013 19:46 140
    Sender E 16/06/2013 15:54 396
    Sender F 16/06/2013 15:54 158
    Sender G 06/10/2013 08:29 1594

    Sheet 2
    Sender Name TransactionDate Net
    Sender B 11/08/2013 19:46 112.5
    Sender A 10/07/2013 22:38 42.5
    Sender F 16/06/2013 15:54 158
    Sender D 11/08/2013 19:46 140
    Sender C 11/08/2013 19:46 32
    Sender G 06/10/2013 08:29 1594
    Sender E 16/06/2013 15:54 396

    I'm trying to search the following:

    If data in column B appears on both sheets & data from column C appears in both sheets then return me the number of time this happens. (this needs to be one calculation not 2 seperate ones)

    So Example: the above should return 7 as all the data in sheet 1 is the same as the data in sheet 2 just sheet 2 is in a diffrent order

    i have tried numerous things, can someone point me in the right direction please

    Thanks

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: How to search multiple columns on seperate sheets for more than one criteria

    Please attach a sample workbook with enough data to make it clear what is needed. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are demonstrated, mock them up manually if needed. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

    Note: Please don't attach documents containing confidential data like (address, telephone, ID#s, etc.).


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Registered User
    Join Date
    11-14-2013
    Location
    Dubai
    MS-Off Ver
    Excel 2010
    Posts
    24

    Re: How to search multiple columns on seperate sheets for more than one criteria

    Attached a small example sheet

    I need to calculate to column E on sheet 1 the following:

    How many times does data in column B Sheet1 and Column C Sheet1 Match the data in column B Sheet2 and Column C Sheet2

    So if B&C on sheet1 match B&C on sheet 2 that counts as 1 occurence.

    On the example sheet the overall for Number of Occurence should should be 3
    Attached Files Attached Files

  4. #4
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: How to search multiple columns on seperate sheets for more than one criteria

    Hi,

    In E2 and copy down:

    =SUMPRODUCT(--(Sheet2!$B$2:$B$4&"|"&Sheet2!$C$2:$C$4=Sheet1!B2&"|"&Sheet1!C2))

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  5. #5
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: How to search multiple columns on seperate sheets for more than one criteria

    Quote Originally Posted by GSmith8 View Post
    the above should return 7
    Can you please explain how you will get 7 ??

  6. #6
    Registered User
    Join Date
    11-14-2013
    Location
    Dubai
    MS-Off Ver
    Excel 2010
    Posts
    24

    Re: How to search multiple columns on seperate sheets for more than one criteria

    Sorry 7 was for the 1st example not the workbook i uploaded.

    For the workbook it should be 3?

  7. #7
    Registered User
    Join Date
    11-14-2013
    Location
    Dubai
    MS-Off Ver
    Excel 2010
    Posts
    24

    Re: How to search multiple columns on seperate sheets for more than one criteria

    Hi XOR,

    I have used this formula as you mentioned. It returns a value to C however sometimes this is more than 1. The data in these 2 fields is that unique that there should be no times that the data in B&C on the 2 sheets match.

    I need to be sure it is counting only if B&C match each other. They both have to match for me to count it.

    Attached sheet as i have it at the moment
    Attached Files Attached Files
    Last edited by GSmith8; 11-19-2013 at 08:26 AM. Reason: Adding Attachment

  8. #8
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: How to search multiple columns on seperate sheets for more than one criteria

    Sorry - I don't understand. Your original post contained: "If data in column B appears on both sheets & data from column C appears in both sheets then return me the number of time this happens".

    And I'm not sure what you mean about the data being unique.

    Just to take one example, in Sheet2, rows 863, 875, 882, 883 & 1042 are the five identical entries with a TransactionDate of 07/04/2013 18:06 and a Net PSL of 22 - hence the formulas in Sheet1 rows 254-257 & 260 return a value of 5.

    Regards
    Last edited by XOR LX; 11-19-2013 at 09:28 AM.

  9. #9
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: How to search multiple columns on seperate sheets for more than one criteria

    Quote Originally Posted by GSmith8 View Post
    For the workbook it should be 3?
    Try the below suggestion in Post #3 attachment file.

    In E2 Cell of Sheet1

    =IF(COUNTIFS($B$2:B2,B2,$C$2:C2,C2)=2,0,COUNTIFS(Sheet2!B:B,Sheet1!B2,Sheet2!C:C,Sheet1!C2))

    Drag it down…

    As per your Post #6 confirmation it will get the total result as 3.

+ 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. formulas for search based on multiple criteria in multiple columns
    By oneworld in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-02-2013, 06:57 AM
  2. search with multiple criteria from 2 sheets with the same order
    By Shacker in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-13-2013, 09:57 AM
  3. Replies: 4
    Last Post: 03-21-2013, 10:02 AM
  4. [SOLVED] Search multiple sheets for criteria and paste all matched rows in new sheet
    By BertLady56 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-14-2012, 01:09 PM
  5. Search multiple sheets for value based on criteria and copy data accordingly
    By Zagadka in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-31-2012, 08:46 AM

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