+ Reply to Thread
Results 1 to 9 of 9

How to show values matching each cell values

  1. #1
    Registered User
    Join Date
    05-06-2014
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    4

    How to show values matching each cell values

    Hi All,

    I have spreadsheet with the names of the cities and the names of the products purchased in each city.
    I would like to do a count of the number of times each product was purchased in each city. Please can you tell the formulae used for this.

    thank you
    Kevin

  2. #2
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: How to show values matching each cell values

    would you consider a pivot table....depending on how your data is setup it's a great solution. Can you upload a small sample with no company confidential data?
    Ernest

    Please consider adding a * if I helped

    Nothing drives me crazy - I'm always close enough to walk....

  3. #3
    Forum Contributor
    Join Date
    11-26-2013
    Location
    Belgium
    MS-Off Ver
    Excel 2010
    Posts
    116

    Re: How to show values matching each cell values

    Hi there!

    I agree with judgeh, a pivot table would be a great solution.

    However if you're not using it, I set up a small file to help you get started if you like:

    Book1.xlsx

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: How to show values matching each cell values

    Your profile says 2003, so dourfil's suggestion will not work for you. You would nee to take a look at using SUMPRODUCT() for that

    However, if you have 2007 or later, you could probably get away with just using countifS()
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Registered User
    Join Date
    05-06-2014
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: How to show values matching each cell values

    Hi,

    Thanks for replying, I didnt know about Pivotal table but have started using that now. Thanks for this. I have another question related to this now.

    So basically from the new pivot table, I now need to pull data of the products from the list countries which are at the moment in the from of country codes,

    I created a list with column filled with the full list of country codes I need, and column B with list of the associated countries for those code. Since the raw data has countries codes associated to the product purchases. I would like to replace the country codes listed in the pivot table with the actual countries, any idea what formulae is used to replace this data accordingly.

    kevin

  6. #6
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: How to show values matching each cell values

    Hi Kevin;

    Is it possible to upload a small sample. It's a bit hard at times to explain what is shown easily in a file...

  7. #7
    Registered User
    Join Date
    05-06-2014
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: How to show values matching each cell values

    hi,

    due to the nature of the data, I cannot share this here, however, I saw this idea shared on some other forum which I am yet to test out, but I will let you know if this works:

    1. Copy and paste (or enter) the following formula in cell C2 =TRIM(MID(B2,SEARCH("-",B2)+1,LEN(B2)-SEARCH("-",B2)))

    2. Copy and paste (or enter) the following formula in cell D2 =--LEFT(B2,3)

    3. Copy the formulas from steps 1 and 2 down the required number of rows

    4. Copy and paste (or enter) the following formula in cell E2 =VLOOKUP(A2,$C$2:$D$5,2,FALSE)&"-"&VLOOKUP(A2,$C$2:$D$5,1,FALSE) but make an adjustment for the last row in Column D (i.e. change 5 to your last data row)

    5. Copy the formula from step 4 down the required number of rows

    6. Convert Column E to values and then cut (move) it over to Column A

    7. Delete Columns C and D


    although I dont know if this single line formulae achieves the same as the above 7 steps: =INDEX($B$2:$B$20000,MATCH("*"&A2,$B$2:$B$20000,0))

  8. #8
    Registered User
    Join Date
    05-06-2014
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: How to show values matching each cell values

    For example:
    Column A
    Atlanta
    Concord
    Nashville
    Memphis

    Column B
    123- Concord
    768-Memphis
    123-Nashville
    333-Atlanta

    (column B should replace column A, then the steps above is expected to this) - any comments on this method?

  9. #9
    Forum Contributor
    Join Date
    11-26-2013
    Location
    Belgium
    MS-Off Ver
    Excel 2010
    Posts
    116

    Re: How to show values matching each cell values

    Please post a sample of the data. Replace your country codes & product names, delete what has to be to preserve confidentiality but I think we need to visualize a bit better- At least I need to^^

+ 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. VBA help needed to fill cell values (offset values) by matching various conditions
    By krjoshi in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-06-2013, 02:14 PM
  2. Replies: 12
    Last Post: 05-10-2013, 11:12 AM
  3. [SOLVED] Return cell values for non-matching & matching criteria
    By jenz_skallemose in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 11-13-2012, 11:52 AM
  4. Replies: 3
    Last Post: 05-31-2012, 01:44 PM
  5. Replies: 2
    Last Post: 02-06-2012, 05:04 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