+ Reply to Thread
Results 1 to 3 of 3

Use countif based on value and cell color in formula

  1. #1
    Registered User
    Join Date
    08-05-2020
    Location
    Belgium
    MS-Off Ver
    365
    Posts
    4

    Use countif based on value and cell color in formula

    Hey

    I am currently creating an overview Excel for our communication project.
    In rows 7, 8, 9 and 10 (starting from column C) all the planned social media posts will be filled in. differentiating the type of post. 1 being a static visual, 2 dynamic template, 3 a video and 4 a premade template.
    Each type has a specific cost. For easy counting lets use the following values:

    1: 100
    2: 200
    3: 300
    4: 50

    I wanted one cell which contained the total cost of all the post. Therefore I used the following formula:

    =(countif(C7:XFD9;1)*100)+countif(C7:XFD9;2)*200)+countif(C7:XFD9;3)*300)+countif(C7:XFD9;4)*50)


    For previous project there wasn't an issue because all posts were posted on the same account.
    For this new project we have several diffrent accounts and I would like to assign a specific color to each one.

    Main account: green (A8)
    Second account: Pink (A9)
    tertiary account: Yellow (A10)

    As before I would like to calculate the total cost of all the different posts but only in cell A8 only for the main account (green), cel A9 for the second account (pink) and in A9 only for our tirtiary account.
    So the formula will need to take the color of the cells into account.

    Creating an UDF so I can use it in other formulas would be ideal.

    I tried to modify the CountcColor VBA code to add an additional condition but can't seemd to make it work and don't really see how I could put it in the above formula.
    Been looking online for several hours and can't seem to find it. :/


    Thanks in advance!
    Attached Files Attached Files

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2504
    Posts
    13,621

    Re: Use countif based on value and cell color in formula

    Welcome to the forum.

    We would very much like to help you with your query, however it has been brought to our attention that the same query has been posted on one or more other forums and you have not provided the required cross-post link(s) here.

    Please see Forum Rule #3 about cross-posting and adjust accordingly. Read this to understand why we (and other sites like us) consider this to be important.

    As you are new I will add it for you this time

    https://www.mrexcel.com/board/thread...rmula.1156032/

  3. #3
    Registered User
    Join Date
    08-05-2020
    Location
    Belgium
    MS-Off Ver
    365
    Posts
    4

    Re: Use countif based on value and cell color in formula

    Hey

    Thank you for pointing it out

    I tried to edit my post but it won't add me any links. Even when I put it in this format mentioned on the website.

    Error: "You are not allowed to post any kinds of links, images or videos until you post a few times."

    Thanks for posting the link for me!

+ 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. [SOLVED] Countif based on cell background color
    By ShamanWolf in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-17-2019, 08:07 PM
  2. Change cell format (cell color+font color) based on color of another cell
    By Dedaluss in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-30-2017, 03:27 AM
  3. Formula based on cell color
    By kimmycoop910 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-21-2016, 02:14 PM
  4. Countif based on cell color
    By BeerKing in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-03-2015, 03:43 PM
  5. [SOLVED] COUNTIF based on a specific color
    By sordid in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-01-2012, 05:19 AM
  6. Countif or VBA based on cell color
    By Georgia Golfer in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-07-2009, 03:59 PM
  7. countif based on fill color
    By edmcf@mot in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-12-2006, 10:25 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