+ Reply to Thread
Results 1 to 7 of 7

Sum cells formatted by conditional formatting

  1. #1
    Registered User
    Join Date
    02-28-2014
    Location
    The Gambia
    MS-Off Ver
    Excel 2021
    Posts
    11

    Sum cells formatted by conditional formatting

    I have an expense worksheet that calculates expenses according to whether they are paid by cash or credit using the respective rates. The way the sheet is set up the cash/credit indicator is bellow the dollar value so it will not work as a SumIf function. I dont want to reformat the sheet if possible. I know that conditional formatted cells can be recognize with a VBA function, but I would rather not make the worksheet that complicated. I am looking for a simpler way, and I think I am either having a mental block or just not looking at this problem the right way.
    For some reason I was not able to upload the sample worksheet with my browser. Basically I am looking for a way to sum the values that are cash payments and the values that are credit payments.

    Any suggestions would be appreciated.

    the formula I used for the conditional formatting is =AND(NOT(ISBLANK(B5)),$B$7="Credit"), and =AND(NOT(ISBLANK(B5)),$B$7="Cash")

    SumConditional Example.jpg
    Attached Files Attached Files
    Last edited by hugowhere; 08-14-2016 at 08:09 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,288

    Re: Sum cells formatted by conditional formatting

    What is the rule that formats the cells? Use that as part of your sum formula. If that doesn't make sense, attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window. The paperclip icon does NOT work at present.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,145

    Re: Sum cells formatted by conditional formatting

    Try

    =SUMIF($B$7:$B$17,"Credit",$B$6:$B$16)

    =SUMIF($B$7:$B$17,"Casht",$B$6:$B$16)

  4. #4
    Valued Forum Contributor
    Join Date
    06-21-2013
    Location
    Bangladesh
    MS-Off Ver
    Excel 2000, Excel XP, Excel 2002, Excel 2007, Excel 2010, Excel 2013
    Posts
    975

    Re: Sum cells formatted by conditional formatting

    According to your uploaded sample :

    For total daily rate
    Please Login or Register  to view this content.
    For total bank rate
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    02-28-2014
    Location
    The Gambia
    MS-Off Ver
    Excel 2021
    Posts
    11

    Re: Sum cells formatted by conditional formatting

    Thank you that works. I did not realize you could have the array overlapping. Not sure exactly this is working but its good.

  6. #6
    Registered User
    Join Date
    02-28-2014
    Location
    The Gambia
    MS-Off Ver
    Excel 2021
    Posts
    11

    Re: Sum cells formatted by conditional formatting

    Thank you. I tested this and it also works. thank you for an alternative option then I was thinking of.

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,288

    Re: Sum cells formatted by conditional formatting

    Quote Originally Posted by hugowhere View Post
    Thank you. I tested this and it also works. thank you for an alternative option then I was thinking of.
    It's a bit like using the OFFSET function:

    =SUMIF(B7:B17,"Cash",B5:B15) - if the cell two cells below the sum range says "Cash", include that value in the sum.

    It's a little trick I keep forgetting about, which is why I'm posting this to try and get it fixed in my head!

+ 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] Conditional Formatting - Silly Question - Why is the column formatted
    By leviathan86 in forum Excel General
    Replies: 5
    Last Post: 07-28-2015, 05:00 PM
  2. [SOLVED] Formatting Formatted cells
    By gz3s36 in forum Excel General
    Replies: 10
    Last Post: 02-06-2014, 06:25 PM
  3. [SOLVED] Conditional formatting for percentage formatted cells
    By boomboomblock in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-22-2013, 07:46 AM
  4. Replies: 2
    Last Post: 06-23-2012, 10:22 AM
  5. Replies: 3
    Last Post: 06-19-2012, 09:56 PM
  6. Replies: 4
    Last Post: 07-30-2010, 09:19 AM
  7. Replies: 2
    Last Post: 08-16-2009, 06:16 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