+ Reply to Thread
Results 1 to 8 of 8

Excel 2010 Comparing column values

  1. #1
    Registered User
    Join Date
    08-12-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    3

    Excel 2010 Comparing column values

    I am trying to use the sumifs() statement to add up values of a column. I have the following worksheet called January in Excel 2010:
    _____________A_____________________ B ___________
    1_________ABC Company_______________100
    2_________Abc Company_______________100
    3_________abc Company_______________100
    4_________Widget Company____________100
    5_________Widget Com________________100
    6_________Widget Comps______________100

    On the Main worksheet I am trying to sum the values for each company:
    ___________ A __________________ B ________________________
    1_______ABC Company___________=SUMIFS(January!$B:$B,January!$A:$A,A1)
    2_______Widget Company_________=SUMIFS(January!$B:$B,January!$A:$A,A2)

    When I do it this way I get $100 for each value in column B of the main worksheet since the names in column A of the main worksheet don’t match the names in column A of the January worksheet. I want to use the Upper() command and the Mid() command to try and match the first 8 values of column A of the main sheet with the first 8 characters in column A of the January worksheet. I want to compare Upper(Mid(A1,1,8)) with the first 8 characters of the January worksheet column A. How can I accomplish this?
    Last edited by Bill001; 08-12-2013 at 12:28 PM.

  2. #2
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,049

    Re: Excel 2010 Comparing column values

    First, dont bother posting the data IN the forum text. Always post a sample data set as it is much easier to digest and propose a solution.

    Second, are you familiar with the left function? You could create a helper column in A of the data and use the left function to grab the first 8 characters then use the following sumifs formula:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    08-12-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Excel 2010 Comparing column values

    Sorry for placing a worksheet in the message. I have atatched a worksheet showing what I am trying to accomplish. I am trying to do this without helper columns since the data set will increase over time and the end user would have to be trained to update the helper column. I would like the end user to be able to dump the data in the monthly worksheets and have it updated automatically.

    Thanks for you help
    Attached Files Attached Files

  4. #4
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Excel 2010 Comparing column values

    There is nothing wrong with the formulae in the workbook. There is however a problem with the data on both the January and February worksheets. The names of the companies are not consistent and the ABC Company also has spaces at the end of the name. These problems will cause the formulae to fail. When the data is corrected, the formulae work properly.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  5. #5
    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,946

    Re: Excel 2010 Comparing column values

    Hi and welcome to the forum

    If you remove the trailing spaces in the date headings on Main, you can use this, copied down and across...
    =SUMIFS(INDIRECT(B$5&"!B:B"),INDIRECT(B$5&"!A:A"),LEFT($A8,8)&"*")

    The LEFT() is pulling the 1st 8 characters from the name on the left - the more characters you can match, the more specific it will be
    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

  6. #6
    Registered User
    Join Date
    08-12-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Excel 2010 Comparing column values

    Thanks for the suggestion. I tried it and I must notbeing putting the formula in there correctly. Can you place the formula in the worksheet and repost it for me to review.

    Thanks

  7. #7
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Excel 2010 Comparing column values

    Is this what you are trying to do?
    In B8, drag across to C8 then down.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Remember to clean all of your data strings

    [EDIT]
    This is the same as Post#5 by FDibbins
    I'll leave it for the example workbook.
    Attached Files Attached Files
    Last edited by Marcol; 08-13-2013 at 09:49 PM. Reason: didn't read all other posts

  8. #8
    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,946

    Re: Excel 2010 Comparing column values

    worksheet attached
    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. Find & Replace text in Word 2010 with Excel 2010 values.
    By pricep in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-14-2015, 06:36 AM
  2. Comparing Variants [Excel 2010/14] (VBA Only)
    By lloydgodin in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 04-16-2013, 03:50 PM
  3. Excel 2010 vba to find values in a column and change it
    By dearnemo385 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-17-2012, 12:17 PM
  4. Replies: 6
    Last Post: 05-17-2012, 12:07 PM
  5. Replies: 3
    Last Post: 03-21-2012, 05:11 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