+ Reply to Thread
Results 1 to 7 of 7

Create 2 Totals, One Based On Name And One Based On Name And Cell Fill Color

  1. #1
    Registered User
    Join Date
    11-08-2005
    Posts
    8

    Create 2 Totals, One Based On Name And One Based On Name And Cell Fill Color

    I have a formula, in my attatchment (= SUMIF($B$7:$B$85,N89,$C$7:$C$85) that totals all numbers in one column associated with a name "JIM" (N89) in another column (formula found in cell B89).

    I also created a formula (=ColorFunction($A$8,$C$7:$C$85,TRUE) in cell C89 that adds everything in a specific range with same the fill color of cell (A8).

    What I need is a formula or VBE code that will total all entries for the name "JIM" (found in cell N89) that have the same fill color as cell A8.
    Thanks so much for your time.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    This should give you the idea.

    Please Login or Register  to view this content.
    ColRng is the cell that has the color you want to match (say B4)
    NameRng is the range that has the names (B4:B13)
    Nme is the cell (or string) that has the name you want to check (N86)
    coloffset is the offset from the name column that has the numbers you want to sum. So if you want to sum column C, then it would be 1).

    In your example workbook put in the formula
    =colorandname(B4,B4:B13,N86,1)
    and it should return 13.42.

    BTW, how did you make your function take the case of your UDF in the workbook???

    rylo

  3. #3
    Registered User
    Join Date
    11-08-2005
    Posts
    8
    Hi, thanks for your response. I'm not sure what you are asking me. Basically I cut and paste things and hope they work...ha ha . What I put into the module was:

    Please Login or Register  to view this content.
    Anyways, I was wondering if you knew how I could make the formula (=colorandname(B4,B4:B13,N86,1) update itself if I was to fill the cells with color after the data was entered? F9 and Ctrl-Alt-F9 does not work.

    I put the code you gave me into a module. Should I enter it as a Macro so I can run it after I have the data and fill color the way it needs to be? Is that even possible? Thanks for your patience
    Last edited by rylo; 06-19-2008 at 08:27 PM.

  4. #4
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    1) OK, doesn't matter.

    2) Enter the line
    Please Login or Register  to view this content.
    as the first line in the function. It won't update when you change the font color, but it will update on F9, or whenever there is a recalc in the worksheet.

    3) Can you please remember to wrap any code in your posts. I've edited your post for you this time.


    rylo

  5. #5
    Registered User
    Join Date
    11-08-2005
    Posts
    8
    Rylo,

    Sorry I am new at all of this (obviously), I will wrap my code next time. What do you mean exactly by enter the line
    Please Login or Register  to view this content.
    I just got an error when I tried it.

    Thanks

  6. #6
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    The function code would be

    Please Login or Register  to view this content.
    rylo

  7. #7
    Registered User
    Join Date
    11-08-2005
    Posts
    8
    Thank you so much for all your answers, time and patience!!

+ 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