+ Reply to Thread
Results 1 to 8 of 8

SUMIF with color criteria

  1. #1
    Registered User
    Join Date
    12-20-2012
    Location
    Ukraine
    MS-Off Ver
    Excel 2007
    Posts
    7

    SUMIF with color criteria

    Hi All,

    I’m in trouble creating a macro that will sum products based on color criteria. I attached a file how should the report look like. The first sheet has to contain production quantities and all cells have to be colored to assigned products, now start the calculation problems - above the table a some kind of “sumif” formula to get the total planned quantities is needed. You know, this takes time to fill in but still a summary report is needed where I need to put together the qty and indicate the product in one cell.
    It takes me a whole day to fill in this report…
    Can someone help with a macro – miracle that can do?

    Hope, You can help
    Alex.
    Attached Files Attached Files

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: SUMIF with color criteria

    Hi sash,

    Product-1 and Product-5 both have the same color (index 37)????
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: SUMIF with color criteria

    Hi,

    May I suggest that you record product names in specific cells rather than trying to analyse data using colours. This is in any case fraught with problems since someone only has to choose a slightly different shade and you're in trouble.

    You'd do better to record your data in a different layout. Have a five column database with columns for Date, Building Line, Shift, Product and Quantity. Building Line, Shift and Products could be drop down Validation cells to assist data capture.

    Once you have this layout you'll find it far simpler to analyse your data with either a Pivot Table or SUMIFS() formulae.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: SUMIF with color criteria

    Hi,
    Attached is your solution. Hope this helps.
    Attached Files Attached Files
    Happy Computing ,

    Xlbiznes.

    To show your appreciation please click *

  5. #5
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: SUMIF with color criteria

    Hi sash,

    I used index 7 for Prod - 5:

    Please Login or Register  to view this content.
    Directions for running the routine(s) just supplied

    Copy the code to the clipboard

    Press ALT + F11 to open the Visual Basic Editor.

    Open a macro-enabled Workbook or save your Workbook As Macro-Enabled

    Select “Module” from the Insert menu

    Type "Option Explicit" then paste the code under it

    With the cursor between Sub and End Sub press F5 (F8 to Single Step)

    OR

    Press ALT + Q to close the code window.

    Press ALT + F8 then double click on the macro name
    Last edited by xladept; 02-25-2013 at 08:54 PM.

  6. #6
    Registered User
    Join Date
    12-20-2012
    Location
    Ukraine
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: SUMIF with color criteria

    Hi All,

    Thanks much for Your feedbacks!!!

  7. #7
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: SUMIF with color criteria

    You're welcome!

  8. #8
    Registered User
    Join Date
    12-20-2012
    Location
    Ukraine
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: SUMIF with color criteria

    Just one question, if I want to calculate quantities in only some specific rows, how do i need to adjust the script?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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