+ Reply to Thread
Results 1 to 12 of 12

Find a value in a cell and check values next to it

  1. #1
    Registered User
    Join Date
    01-07-2015
    Location
    Sweden
    MS-Off Ver
    Office 365
    Posts
    6

    Find a value in a cell and check values next to it

    Hello.

    I'm looking for a function that counts the number of occurrances of values in cells next to eachother in two columns.

    For example, say I want to search for the following strings randomly placed in the range A1:B30:

    "hello"
    "good bye"
    "farewell"
    "good night"
    "good morning"

    Say I want to search for "hello" in that range and if found in either column A or B it checks the cell next to it in the other column.
    Then I need to count how many times each combination occurs in another column D and in seperate cells, kinda like this below:

    Column C Column D
    Word Combination Occured
    "hello"+"good bye" 5
    "hello"+"farewell" 3
    ...
    "farewell"+"good bye" 3
    ...
    etc

    Appreciate any help.
    Attached Files Attached Files
    Last edited by Macks; 01-07-2015 at 11:21 PM. Reason: Added sample

  2. #2
    Forum Contributor
    Join Date
    10-29-2014
    Location
    udaipur, rajasthan
    MS-Off Ver
    2007
    Posts
    352

    Re: Find a value in a cell and check values next to it

    Hi,

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. 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 shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.
    If answer helped you say Thanks by Add Reputation

  3. #3
    Registered User
    Join Date
    01-07-2015
    Location
    Sweden
    MS-Off Ver
    Office 365
    Posts
    6

    Re: Find a value in a cell and check values next to it

    Added a sample of what I need for my worksheet.

  4. #4
    Forum Contributor
    Join Date
    10-29-2014
    Location
    udaipur, rajasthan
    MS-Off Ver
    2007
    Posts
    352

    Re: Find a value in a cell and check values next to it

    Hi,

    As per my understanding, i have done with 2 helper column,,, looking for like this?

    see the file plz.
    Attached Files Attached Files

  5. #5
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,915

    Re: Find a value in a cell and check values next to it

    Hi Macks,
    Welcome to the forum,
    Enter result manually for 2 or 3 items
    if possible give more details about the requirement
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  6. #6
    Registered User
    Join Date
    01-07-2015
    Location
    Sweden
    MS-Off Ver
    Office 365
    Posts
    6

    Re: Find a value in a cell and check values next to it

    That doesn't seem to work correctly. I type "orange" and "keyboard" in all 10 rows and it still is only 1 count.
    Attached Files Attached Files

  7. #7
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,915

    Re: Find a value in a cell and check values next to it

    =COUNTIFS($A$3:$A$12,$C3,$B$3:$B$12,$D3)
    Try this in E3 and copy towards down

  8. #8
    Registered User
    Join Date
    01-07-2015
    Location
    Sweden
    MS-Off Ver
    Office 365
    Posts
    6

    Re: Find a value in a cell and check values next to it

    Exactly this is what I have:

    A field of 2 columns (D3:E100) with randomly placed words.
    Three more columns F, G and H where F and G should contain the word combination and H the number of occurance of the word combination.

    What I need is:

    In the cell next to a word combination (say "orange" and "keyboard") I need something that searches for "orange" in the range D3:E100 and checks if "keyboard" is found in the cell next to it. (strings need to work)
    What should be displayed in the cell is the count of the occurance of a specific word combination.

  9. #9
    Registered User
    Join Date
    01-07-2015
    Location
    Sweden
    MS-Off Ver
    Office 365
    Posts
    6

    Re: Find a value in a cell and check values next to it

    Quote Originally Posted by nflsales View Post
    =COUNTIFS($A$3:$A$12,$C3,$B$3:$B$12,$D3)
    Try this in E3 and copy towards down
    That doesn't work exactly as required. What I need is something that searches for a word combination in a range and the word to search for can be either in the first or second column. This assumes that the word is in the first column.
    Last edited by Macks; 01-07-2015 at 07:30 AM.

  10. #10
    Valued Forum Contributor
    Join Date
    02-05-2013
    Location
    Jakarta, Indonesia
    MS-Off Ver
    Excel 2013
    Posts
    571

    Re: Find a value in a cell and check values next to it

    Like this?

    Please Login or Register  to view this content.
    Click (*) if you received helpful response.

    Regards,
    David

  11. #11
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,915

    Re: Find a value in a cell and check values next to it

    =COUNTIFS($D$3:$D$100,$F3,$E$3:$E$100,$G3)+COUNTIFS($D$3:$D$100,$G3,$E$3:$E$100,$F3)
    Try this
    if it is not what you are looking for attach sample file with desired result

  12. #12
    Registered User
    Join Date
    01-07-2015
    Location
    Sweden
    MS-Off Ver
    Office 365
    Posts
    6

    Re: Find a value in a cell and check values next to it

    Thanks guys. I solved it with a helper column and the following formula in the cell:

    =(COUNTIF(G$3:$G$24;CONCATENATE(C3;" ";D3)))+(COUNTIF($G$3:$G$24;CONCATENATE(D3;" ";C3)))

    See final_sample.xlsx
    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)

Similar Threads

  1. [SOLVED] Check if cell value is between cell values in column A and B for multple rows
    By tunestal in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 03-20-2014, 03:41 PM
  2. Find Empty Cell Check Next Column For a Value
    By basketball2524 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-19-2014, 11:21 AM
  3. [SOLVED] Check for existing cell values in another cell and remove them + 1 character.
    By ali.whitaker in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-21-2013, 06:17 AM
  4. a macro to check cell values against other cell values
    By ncarrocino in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-22-2012, 12:59 PM
  5. Check whether Find returns a cell?
    By dgtvr in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-08-2008, 04:01 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