Results 1 to 8 of 8

Correct syntax for function to find average based on background color of cells in range

Threaded View

  1. #1
    Forum Contributor
    Join Date
    02-22-2014
    Location
    Winthrop, ME
    MS-Off Ver
    Excel 2010
    Posts
    420

    Correct syntax for function to find average based on background color of cells in range

    Good afternoon. I'm working on a workbook that will track staffing patterns.

    The workbook has three worksheets: Sheet1 "RCS", Sheet2 "HCT' and Sheet3 "Hidden". I've attached the workbook to this thread. The password for the form is "j".

    On Sheet3 "Hidden" I have two tables that are set up to collect the SUM of columns on Sheets1 "RCS" and Sheet2 "HCT". I'm finding the SUM of each range by way of the background color. I've set up the following formulas and when the "data collection tables" are in the same worksheets as the original information, the formula's work perfectly:

    The following functions are pulling data from Sheet1 "RCS" and placing them into a table in Sheet2 "Hidden"


    =ColorFunction($B$25,$C$1:RCS!$C$115,TRUE)
    =ColorFunction($B$26,$D$5:RCS!$D$115,TRUE)
    =ColorFunction($B$27,$G$5:RCS!$G$115,TRUE)
    The following functions are pulling data from Sheet1 "RCS" and placing them into a table in Sheet2 "Hidden"

    =ColorFunction($B$15,HCT!$C$5:$C$110,TRUE)
    =ColorFunction($B$16,HCT!$D$5:$D$110,TRUE)
    =ColorFunction($B$17,HCT!$E$5:$E$110,TRUE)
    =ColorFunction($B$18,HCT!$H$1:$H$110,TRUE)
    I have two more functions that aren't working due to the fact that the source values are percentages and NOT plain numbers. The above functions work great for SUM but not for percentages. EXAMPLE--Let's say, 3 sub percentages it gives me the SUM of the 3 percentages (i.e. 85% + 100% + 100% = 285% instead of giving me 95%.

    =ColorFunction($P$5,RCS!$I$5:$I$120,TRUE)
    
    =ColorFunction($P$11,HCT!$J$1:$J$115,TRUE)
    How might I use the following functions to find the average of the source fields instead of the SUM?

    I appreciate any feedback you might be able to offer to me. Thanks.

    Matthew
    Attached Files Attached Files
    Last edited by moosetales; 05-20-2014 at 03:03 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Macro to set value based on range of different cells with background color.
    By prem4u in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-28-2014, 12:55 PM
  2. Macro to copy rows based on background color of cells within a range of columns
    By jpitt916 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-21-2013, 06:16 PM
  3. [SOLVED] Macro to copy rows based on background color of cells within a range of columns
    By Chrispelletier in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-19-2013, 01:30 PM
  4. [SOLVED] Sum and average cells based on background color
    By Kaitlynn in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-22-2013, 12:51 PM
  5. [SOLVED] Find all cells with a specific background color then copy/paste to correct column
    By d_rose in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-20-2012, 10:18 AM

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