Ignore if cell in colour

Shakes007

Board Regular
Joined
Jul 1, 2012
Messages
91
Office Version
  1. 365
Platform
  1. Windows
Hi All,
Column A, As a sum to add all numerical data in that column. If any of the cells in the column are filled with colour, can they be excluded from the sum? Not sure this can be done but I may (hopefully am) wrong.
Thanks
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
There is no built-in function in Excel to return what fill color a cell has. So this would require a custom function written in VBA. Can you use VBA for this?

Also, are the cells colored manually, or are you using conditional formatting?
 
Upvote 0
There is no built-in function in Excel to return what fill color a cell has. So this would require a custom function written in VBA. Can you use VBA for this?

Also, are the cells colored manually, or are you using conditional formatting?
Hi, I am using a conditional format for filling in the cells and I have never used VBA.
 
Upvote 0
As you are using conditional formatting for the colour, this can usually be built into a SUMIF function to create the sum you require. The easiest option to get help on this one would be to share here the formula you are using for the conditional formatting.
 
Upvote 0
As you are using conditional formatting for the colour, this can usually be built into a SUMIF function to create the sum you require. The easiest option to get help on this one would be to share here the formula you are using for the conditional formatting.
Hi,
The Formula I am using in the conditional format is = =IF(ISTEXT,D33)
 
Upvote 0
Deleted, I see you want to sum column A, based on what is in column D
 
Upvote 0
Maybe the below will do it?
Book1
ABCD
1NumsTest column
211
35text
411
57text
611
711
811
91text
1011
1111
1211
1311
14
1513
Sheet2
Cell Formulas
RangeFormula
A15A15=SUM(ISTEXT(D2:D13)*A2:A13)
 
Upvote 0
Maybe the below will do it?
Book1
ABCD
1NumsTest column
211
35text
411
57text
611
711
811
91text
1011
1111
1211
1311
14
1513
Sheet2
Cell Formulas
RangeFormula
A15A15=SUM(ISTEXT(D2:D13)*A2:A13)
I will try to explain with added snippet. The green is added to the 1st column when I add the date of payment in 2nd column. The 1st column as a sum to show total. What I would like is when I have paid the bill and the column (cell) goes to Green, that payment it is removed from the total. This would then just sum remaining owed for that month
 

Attachments

  • Mr. Excel.png
    Mr. Excel.png
    19.3 KB · Views: 4
Upvote 0
Maybe we could just replace ISTEXT with ISBLANK:
Book1
CD
1NumsTest column
2£1.0004/12/2023
3£5.0005/12/2023
4£1.0006/12/2023
5£7.0007/12/2023
6£1.0008/12/2023
7£1.00
8£1.00
9£1.00
10£1.00
11£1.00
12£1.00
13£1.00
14
15£7.00
Sheet2
Cell Formulas
RangeFormula
C15C15=SUM(ISBLANK(D2:D13)*C2:C13)
 
Upvote 0
Or even a SUMIF formula:
Book1
CD
1NumsTest column
2£1.0004/12/2023
3£5.0005/12/2023
4£1.0006/12/2023
5£7.0007/12/2023
6£1.0008/12/2023
7£1.00
8£1.00
9£1.00
10£1.00
11£1.00
12£1.00
13£1.00
14
15£7.00
Sheet2
Cell Formulas
RangeFormula
C15C15=SUMIF(D2:D13,"",C2:C13)
 
Upvote 0

Forum statistics

Threads
1,215,218
Messages
6,123,676
Members
449,116
Latest member
HypnoFant

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top