Conditional formatting

Stclements1

Board Regular
Joined
Sep 15, 2018
Messages
158
Office Version
  1. 365
Platform
  1. Windows
I am trying to write a new rule in conditional formatting but am having problems. In column S starting with cell S2 through to S30 I want to format the spreadsheet so that if the value in any of the S column is >0 then the corresponding row should be formatted with a yellow fill. Then I want the value in cell M35 to be the sum of all the values in column M that are not filled. I:e there is no value in the corresponding cell in column S
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
It isn't clear what sort of data you have in column S. For the future it would assist your helpers considerably if you would consider using XL2BB for providing sample data & expected results to make it easier for helpers to understand just what you have & where it is and also what you want & where it is to be.

Anyway, see if any of this helps.

23 11 04.xlsm
ABCLMNOPQRS
1
216
322
43-3
54
615
72-2
831
94
101
112
123
134
14
15
28
29
30
31
32
33
34
3523
CF
Cell Formulas
RangeFormula
M35M35=SUM(M2:M30)-SUMIF(S2:S29,">0",M2:M30)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:S30Expression=$S2>0textNO
 
Last edited:
Upvote 0
Many thanks for your explanation although I tried it and it didn't seem to work for me. I have attached the spreadsheet to give you greater clarity. I tried to use the XL2BB but I kept receiving a message saying "the file type is not supported in protected view", which I didn't know how to fix. In cell M48 I am trying create a formula that gives me the sum of all outstanding values in column M that have not been paid based on the corresponding value in column S. If the corresponding value in column S is 0 then its value in column M will be added to the value in cell M48 and if the corresponding value in column S is greater than 0 then no value is added from the corresponding cell in column M to the value in cell M48. Then when the value in column S is greater than 0 then the row should be conditionally formatted to have a yellow fill. I tried to upload the spreadsheet to assist you but I was unable to do so.
 
Upvote 0
message saying "the file type is not supported in protected view"
Review the first bullet point in the "Known XL2BB Issues" near the top of the XL2BB Instructions & Download page.

Sounds like your data may be more like this

23 11 04.xlsm
ABCLMNOPQRS
1
211
322
430
540
611
720
833
940
1010
1120
1230
1340
14
15
28
29
30
31
32
33
34
3523
CF
Cell Formulas
RangeFormula
M35M35=SUMIF(S2:S29,0,M2:M30)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:S30Expression=$S2>0textNO
 
Upvote 0
My apologies, the formula does work the reason it wasn't previously is that in Column S I have the code =if(T2>0,"1","") and with the code in the cell the formula you gave me wouldn't not work, once I removed the formula from column S your formula worked. The problem I have is I wanted S column to have a 1 generated every time there was a value in the corresponding cell in column T and now it would seem I have to do this by hand, unless you know where I am going wrong. I get the impression that the formula in cell M35 wont read any value in column S whilst there is an underlying formula in there.
 
Upvote 0
My apologies, the formula does work the reason it wasn't previously is that in Column S I have the code =if(T2>0,"1","") and with the code in the cell the formula you gave me wouldn't not work, once I removed the formula from column S your formula worked. The problem I have is I wanted S column to have a 1 generated every time there was a value in the corresponding cell in column T and now it would seem I have to do this by hand, unless you know where I am going wrong. I get the impression that the formula in cell M35 wont read any value in column S whilst there is an underlying formula in there.

Try these updates then:



Mr Excel Questions 71.xlsm
MSTUVWXYZ
1
2516
3316
4516
56 
64 
73 
83 
96 
104 
114 
12614
13613
14314
15416
16616
174 
186 
193 
204 
21516
22614
23615
24513
25614
264 
276 
28616
29613
30613
31
32
33
34
3584
StClements1
Cell Formulas
RangeFormula
S2:S30S2=IF(T2>0,1,"")
M35M35=SUMIF($S$2:$S$30,">0",$M$2:$M$30)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
M2:Z30Expression=AND($S2>0,$S2<>"")textNO
 
Upvote 0
Thank you all so much it is all working perfectly now.
Many thanks.
You're welcome. Glad we could help.

I have removed the solution mark from post #7. Please mark the post as the solution that actually answered your question, instead of your feedback message as it will help future readers.

the reason it wasn't previously is that in Column S I have the code =if(T2>0,"1","")
Remove the quotes from around the 1, after all it should be a number, not a text value
Excel Formula:
=if(T2>0,1,"")
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,824
Messages
6,181,186
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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