+ Reply to Thread
Results 1 to 5 of 5

search for 2 'codes' on 1 line to return a value

  1. #1
    Registered User
    Join Date
    04-02-2016
    Location
    Sydney
    MS-Off Ver
    2013
    Posts
    12

    search for 2 'codes' on 1 line to return a value

    Hello,

    Can anyone show me the formula to search for the 2 codes (B in 1 column then X from another column) on the same line and return a value into the 1st tab on the spreadsheet?

    Thank you
    Attached Files Attached Files
    Last edited by Nae2016; 04-22-2016 at 09:20 PM.

  2. #2
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: search for 2 'codes' on 1 line to return a value

    do you mean a formula like this? =IF(AND(Sheet2!A2="b",Sheet2!E2="x"),1,0)
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: search for 2 'codes' on 1 line to return a value

    OR, do you mean something like either of these?
    =COUNTIFS(Sheet2!A:A,"b",Sheet2!E:E,"x")
    =COUNTIFS(Sheet2!A:A,LEFT(A1,1),Sheet2!E:E,RIGHT(A1,1))

  4. #4
    Registered User
    Join Date
    04-02-2016
    Location
    Sydney
    MS-Off Ver
    2013
    Posts
    12

    Re: search for 2 'codes' on 1 line to return a value

    yes, something like that. Now, if I need to apply that formula to a spreadsheet where there are multiple entries (same format) not all column E will have an X (see the attached updated spreadsheet)

    I need the total count of how many lines contain b&x. for some reason when I apply your formula into my spreadsheet, its coming up with a 0.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    04-02-2016
    Location
    Sydney
    MS-Off Ver
    2013
    Posts
    12

    Re: search for 2 'codes' on 1 line to return a value

    =COUNTIFS(Sheet2!A:A,"b",Sheet2!E:E,"x") was the winner!

    Thanks so much Sambo Kid!

+ 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. Replies: 1
    Last Post: 01-13-2016, 10:22 PM
  2. I have VBA codes want to add a line in it
    By harishb63 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-28-2013, 04:05 AM
  3. Search for a line in all Modules in a workbook and add extra line below
    By sans in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-20-2013, 03:17 PM
  4. Replies: 2
    Last Post: 10-08-2012, 12:49 PM
  5. combobox line codes, can they be combined somehow
    By 55horses in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-11-2012, 03:25 PM
  6. Return value after searching zip-codes
    By Oscar Fox in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-14-2011, 01:29 AM
  7. Replies: 2
    Last Post: 03-21-2006, 08:30 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