SUMPRODUCT formlua works inside the sheet but not in conditional formatting

Ramadan

New Member
Joined
Jan 20, 2024
Messages
9
Office Version
  1. 2021
Platform
  1. Windows
Guys, while I'm testing a SOMPRODUCT formula in the excel sheet it works fine and gives me ture or false result based on the range values , but when I try to use the same formula in conditional formatting I get errors evrytime, please let me know what's I'm doing wrong - here is the formula

=SUMPRODUCT(('Stop Work'!$D$8:$D$500=$C11)*('Stop Work'!$K$8:$K$500="Open")*('Stop Work'!$C$8:$C$500=$B$2))*($T$10:$T500=$B$3)

it was working good in conditional formatting before I add the last condition which is this part *($T$10:$T500=$B$3)
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
you have T10
should be T8
to match ranges

try
*($T$8:$T500=$B$3)
Thanks Mr. Etaf, maddly it didn't give error now even with keeping it the same *($T$10:$T500=$B$3) don't know how !! but i didn't apply the condition as I need
look, will explain what i need, i was working with this formula =SUMPRODUCT(--('Stop Work'!$D$8:$D$500=$C10)*('Stop Work'!$K$8:$K$500="Open")*('Stop Work'!$C$8:$C$500=$B$2)) the to check if C10 in this sheet = any cell in stopwork sheet column "D" and "K" in stopworksheep = "Open" + also check if "C" in stopworksheet = $B$2 in this sheet then change the row color
till this part i was working perfectly but i want to add another condition says to check also if "T" in this sheel also in blank... and my table in the active cheet start with T10 thats why I put $T$10
 
Upvote 0
not following , as
*($T$10:$T500=$B$3) is NOT in the same sheet and starts at row 10

Therefore -

A SMALL sample spreadsheet, around 10-20 rows, would help a lot here, with all sensitive data removed, and expected results mocked up and manually entered, with a few notes of explanation.

This will possibly enable a quicker and more accurate solution for you.

MrExcel has a tool called “XL2BB” that lets you post samples of your data and will allow us to copy/paste your sample data into our Excel spreadsheets, saving a lot of time.

You can also test to see if it works ok, in the "Test Here" forum.

OR if you cannot get XL2BB to work, or have restrictions on your PC

then put the sample spreadsheet onto a share

I only tend to goto OneDrive, Dropbox or google docs , as I'm never certain of other random share sites and possible virus.
Please make sure you have a representative data sample and also that the data has been desensitised, remember this site is open to anyone with internet access to see - so any sensitive / personal data should be removed

Make sure you set any share or google to share to everyone
 
Upvote 0
not following , as
*($T$10:$T500=$B$3) is NOT in the same sheet and starts at row 10

Therefore -

A SMALL sample spreadsheet, around 10-20 rows, would help a lot here, with all sensitive data removed, and expected results mocked up and manually entered, with a few notes of explanation.

This will possibly enable a quicker and more accurate solution for you.

MrExcel has a tool called “XL2BB” that lets you post samples of your data and will allow us to copy/paste your sample data into our Excel spreadsheets, saving a lot of time.

You can also test to see if it works ok, in the "Test Here" forum.

OR if you cannot get XL2BB to work, or have restrictions on your PC

then put the sample spreadsheet onto a share

I only tend to goto OneDrive, Dropbox or google docs , as I'm never certain of other random share sites and possible virus.
Please make sure you have a representative data sample and also that the data has been desensitised, remember this site is open to anyone with internet access to see - so any sensitive / personal data should be removed

Make sure you set any share or google to share to everyone
I hope this screenshot can help to understand what I need
as you can see sheets name at the bottom and i apply this condition to all sheets based on data from the last one "stopwork"
image one is the sheet I'm oworking on and table starts with row #10 and as you can see when I wrote "1" in T11 still the row colored in red while it shouldn't because B3 in empty *($T$10:$T500=$B$3)
image 2 is the stopwork sheet table starts with row #8

1.png
2.png
 
Upvote 0
you would need a different rule to stop that , as i say you are using a different sheet and row range in sumproduct , i'm not sure it can do that

Are you sure the orginal formula is working OK
=SUMPRODUCT(('Stop Work'!$D$8:$D$500=$C11)*('Stop Work'!$K$8:$K$500="Open")*('Stop Work'!$C$8:$C$500=$B$2))

$C11 , seems a strange , cell to reference

So what do you want to happen with
$T$10:$T500=$B$3)
you could possibly use AND to include that condition with maybe a countif()
 
Upvote 0
you would need a different rule to stop that , as i say you are using a different sheet and row range in sumproduct , i'm not sure it can do that

Are you sure the orginal formula is working OK
=SUMPRODUCT(('Stop Work'!$D$8:$D$500=$C11)*('Stop Work'!$K$8:$K$500="Open")*('Stop Work'!$C$8:$C$500=$B$2))

$C11 , seems a strange , cell to reference

So what do you want to happen with
$T$10:$T500=$B$3)
you could possibly use AND to include that condition with maybe a countif()
yes this formual is working perfectly till this end
=SUMPRODUCT(('Stop Work'!$D$8:$D$500=$C10)*('Stop Work'!$K$8:$K$500="Open")*('Stop Work'!$C$8:$C$500=$B$2)) - sorry for c11 it's C10 but was testing it on another row

till this end it's very good and what I need is only to add one more condition which is to ckeck if "T" in sheet1 ( the sheet which I'm working on) is empty or blank so I left B3 empty and made the condition like this ( $T$8:$T500=$B$3) and it works but with conflict as i explained - when I put any data in "T" nothing change but when I put any data in B3 it works don't know why

so, if I want to add AND to this formula
=SUMPRODUCT(('Stop Work'!$D$8:$D$500=$C10)*('Stop Work'!$K$8:$K$500="Open")*('Stop Work'!$C$8:$C$500=$B$2))
and to add this condition ( $T$8:$T500=$B$3) how should it be

thank you again
 
Upvote 0
you could just add an AND

=AND( SUMPRODUCT(('Stop Work'!$D$8:$D$500=$C10)*('Stop Work'!$K$8:$K$500="Open")*('Stop Work'!$C$8:$C$500=$B$2)) , $T10=$B$3)
So now its only true if both conditions are MET

SO when it gets to your example image T11 , as that is NOT blank which B3 is , then it will be false

Assuming your Conditional formatting range , is starting at row 10
 
Upvote 0
AUTHs.xlsm
BCDEFGHIJKLMNOPQRST
7SUnit No.Owner NamePhone No.Auth. Date Authorized PersonnelH.OINS Work PermitRemarks
8Name Phone No.Name Phone No.Name Phone No.Name Phone No.ReportCheque StatusExp. Date
9Column1LColumn3Column4Column5Column6Column7Column8Column9Column10Column11Column12Column13Column133Column132Column14Column15Column152Column16
10108 NEW 37السيد احمد محمد ابراهيم0128810173816.01.23عبد الرحمن لبيب01002002601OK 
11210 NEW 09مصطفى يحيى محمد0111807777717.01.22عبد الله طارق اسماعيل01099511271N/AOKOK17.03.22
123 104 NEW 02احمد حلمى طولان0111001007411.04.22محمد احمد وحيد01063783019N/AOKOKGL
134 20 NEW 25عماد عبد العال الريدى0122360913203.08.23احمد حسام ابراهيم01556721444N/AOKOK02.10.23
14514 NEW 50احمد سمير محمد نور سالم0109777231002.06.21اسلام وحيد ابراهيم01110006318OK 
15621 NEW 27سامر فايز واصف0100109282604.07.23جمال محمد العطار01001800180احمد جمال محمد 01009990727N/AOKOK03.09.23
16719 NEW 449عادل فاروق مهنى0122215111714.09.20شريف الهوارى01000366337ابراهيم محمد01118783067 
17819 NEW 479احمد على احمد عبد الرحمن0100141016506.07.21شريف على01111099988 
18920 NEW 478احمد هشام عبد الغنى0100000890431.08.22محمد شجاع محمد على01121503701احمد محمد فاخورى01113317283علاء الدين عبد الباقى01028647400حسين ناصر + 4 اخرين01001563180 
191020 NEW 412نهى مجدى احمد0100003350311.12.22عمر شريف محمود عطيه01004995522 
2011 29 NEW 28مصطفى محمد ابراهيم0112404440926.11.21احمد اسماعيل ممدوح01003480098N/AGLOK05.02.22
2112 72 NEW 15 هدى مصطفى محمد سعودى0122211778016.03.22محمد عونى سيد01126482294حميد عونى سيد احمد01006256608N/AOKOKGL
2213 89 NEW 26عبد العظيم عصام الدين عبد العظيم01002109352سامر لطفى حبيب01220781311جون عطبيه عبد المسيح01019191469احمد اشرف احمد01155006820وحيد ثابت01001803440N/AGLOKGL
231439 NEW 179محمد عبد السلام الشافعى01001801113احمد مسلم الدين عبد المط01000015338 
241507 NEW 461محمد خالد عبد المجيد البارونى0122217137102.04.24محمد نادر درويش01002661882عبد الله عبد القادر ع الهادى01228333888عمر لطفى01064737648FinishedOKOK22.06.24
251647 NEW 11كريم محمود حسن الطوخى0100614911022.02.23عادل عبده خالد عفيفى01015888312OK 
2617100 NEW 29كريم عوض محمد0100566040410.12.21مؤمن عبد العظيم01006051644منه القاضى01001212982ياسر عبد الله حامد01226141175N/AGLOKGL
271811 NEW 31علاء عادل مراد ذكرى0122210269023.03.22مروج وحيد رأفت01004837778حسن محمد حسن01100690554N/AGLOKGL
281911 NEW 31علاء ذكرى0122210269008.02.22هشام محمد مجدى01227417043فرح محمد عبد السلام01223344567N/AGLOKGL
292054 NEW 02امل سالم محمود الوكيل0100076672516.07.20خالد محمود عبد السميع01112522889محمد مسعد01115544010 
302155 NEW 26احمد صلاح جادو0122312590608.11.21احمد عبد المعطى حسن01069669919 
3122119 NEW 111محمد محمود احمد عبد الحافظ0100086095230.01.23ياسر عبد العال01012030455N/AGLOKGL
322358 NEW 71 محمد احمد عبد الوهاب احمد+868764159430.08.22اسلام توفيق ابو شادى01004572373محمد على حامد01093167187خالد سيد عبد الرحمن01149894119OK الغاء بامر المالك شخصيا 26/12X
332463 NEW 44رنا ماهر محب استينو0128620665520.02.22ابراهيم محمد مصيلحى01275513688 
3425123 NEW 01طاهر يحيى محمد01000184484محمد مصطفى محمدعطوه سيد حسنN/AGLOKGL
3526123 NEW 119مصطفى على عبد اللطيف محمد0122745922322.01.24محمد احمد حفنى01285030555ClearOKOK22.03.24
3627129 NEW 131ايهاب محمد فتحى الاشقر0122214097011.01.23رضا عبد المقصود01221009999مصطفى محمد مصطفى01281555313احمد محمد عطا01289164446N/AGLOKGL
372813 NEW 469نهال عصام ابراهيم0100167400717.04.24على احمد السيد سالم01006279816ايهاب محمد احمد السيد01092916521سيف طلعت01006477799ClearOKOK17.06.24
3829131 NEW 12رانيا احمد كمال عبيد+9745514037517.01.21احمد كمال عبد الحميد01222396627احمد شعبان بدير01110617830N/AOKOKGL
393081 NEW 35شريف جابر فرج حشاد+97150788939511.05.22محمد حسين عبد الحميد01093707120طارق عبد المحسن 01007583846 
4031132 NEW 13محمود صلاح الدين بسيونى0100866663004.04.24محمد عبد الحميد عبد الله01001840952FinishedOKOK07.07.24
Ivory
Cell Formulas
RangeFormula
B10:B40B10=IF([@L]<>"",ROW()-ROW($B$9),"")
Q10:Q40Q10=IF($R10<>"","OK","")
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B10:T326Expression=SUMPRODUCT(('Stop Work'!$D$8:$D$500=$C10)*('Stop Work'!$K$8:$K$500="Open")*('Stop Work'!$C$8:$C$500=$B$2))textNO
C10:C326Expression=AND(ISBLANK($P10),$R10<>"",$T10="")textNO
C10:C326Expression=$T10<>""textNO
C10:C326Expression=AND($D$3<>"",ISNUMBER(SEARCH($D$3,$G10&$I10&$K10&$M10)))textNO
C10:C326Expression=(AND($P10<>"",$E10<>"",$R10="",$T10=""))textNO
C10:C326Expression=(AND($P10<>"",$E10="",$R10="",$T10=""))textNO
C10:C326Expression=AND(ISBLANK($P10),ISBLANK($R10),ISBLANK($T10))textNO
C10:C326Expression=(AND($P10<>"",$R10<>"",($T10="")))textNO
B10:T326Expression=AND(ISBLANK($P10),$R10<>"",$T10="")textNO
B10:T326Expression=$T10<>""textNO
B10:T326Expression=AND($D$3<>"",ISNUMBER(SEARCH($D$3,$G10&$I10&$K10&$M10)))textNO
B10:T326Expression=(AND($P10<>"",$E10<>"",$R10="",$T10=""))textNO
B10:T326Expression=(AND($P10<>"",$E10="",$R10="",$T10=""))textNO
B10:T326Expression=AND(ISBLANK($P10),ISBLANK($R10),ISBLANK($T10))textNO
B10:T326Expression=(AND($P10<>"",$R10<>"",($T10="")))textNO
B11:T323Expression=AND(ISBLANK($P11),$R11<>"",$T11="")textNO
B11:T323Expression=$T11<>""textNO
B11:T323Expression=AND($D$3<>"",ISNUMBER(SEARCH($D$3,$G11&$I11&$K11&$M11)))textNO
B11:T323Expression=(AND($P11<>"",$E11<>"",$R11="",$T11=""))textNO
B11:T323Expression=(AND($P11<>"",$E11="",$R11="",$T11=""))textNO
B11:T323Expression=AND(ISBLANK($P11),ISBLANK($R11),ISBLANK($T11))textNO
B11:T323Expression=(AND($P11<>"",$R11<>"",($T11="")))textNO


AUTHs.xlsm
BCDEFGHIJK
6SNHUnit No.DescriptionIssued By Eng.Stop DateResume DateIssued By Eng.RemarksStatus
7Column1Column2Column3Column4Column5Column6Column7Column8Column9Column10
81NH03V 111 NEW V 95تركيب برجوله فى اللاند سكيبEng. Ahmed Anwer14.04.2330.04.23Eng. Ahmed AnwerDone
92NH05RW09 - 391modifications without any approvalsEng. Ahmed Anwer04.06.2306.06.23Eng. Ahmed AnwerDone
103NH04VB - 05مخالفة لون الوجههEng. Abdullah Mohsen04.06.2308.06.23Eng. Abdullah MohsenDone
114NH05RT09 - 11Modifications Eng. Ahmed Anwer02.05.2321.06.23Eng. Ahmed AnwerDone
125NH05 TV10 - 56Aclient removed the corner LouverEng. Ahmed Anwer18.06.2321.06.23Eng. Ahmed AnwerDone
136NH07 AV 04A -G1the client to remove the opened windows Eng. Ahmed Anwer21.06.2321.06.23Eng. Ahmed AnwerDone
147NH05 TV10 - 37AEng. Ahmed Anwer01.12.2421.06.23Eng. Ahmed AnwerDone
158NH02F4 - 04Building wall in the gardenEng. Abdullah Mohsen25.06.2318.07.23Eng. Abdullah MohsenDone
169NH04RW09A - 35making a partition Eng. Abdullah Mohsen25.05.2324.07.23Eng. Abdullah MohsenDone
1710NH04LS WF 23Rتكسير في جدار الادوار الخاص بالوحدة Eng. Abdullah Mohsen12.08.2312.08.23Eng. Abdullah MohsenDone
1811NH04RW08 - 50تكسير بالجدران الدور الاولEng. Abdullah Mohsen15.07.2323.08.23Eng. Abdullah MohsenDone
1912NH04RW10 - 100violation in pergolaEng. Abdullah Mohsen22.08.2323.08.23Eng. Abdullah MohsenDone
2013NH04RW09 - 55تكسير وتعديلات Eng. Abdullah Mohsen09.08.2327.08.23Eng. Abdullah MohsenDone
2114NH04RT10 - 48تكسير وعمال فتحات بالدور الاولEng. Abdullah Mohsen20.08.2305.09.23Eng. Abdullah MohsenVerbalDone
2215NH04RT09 - 149Damage Eng. Abdullah Mohsen10.09.2311.09.23Eng. Abdullah MohsenDone
2316NH02F405تركيب أرضية خشبية وبرجولة خشبيةEng. Abdullah Mohsen06.08.2307.10.23Eng. Abdullah MohsenDone
2417NH01156 NEW 46بناء بالطوب ) اعلى الفيلا Eng. Abdullah Mohsen13.10.2315.10.23Eng. Abdullah MohsenDone
2518NH0134 NEW 121لحين تركيب حاجز اخضر على الفيلا من الخارجEng. Abdullah Mohsen17.10.2317.10.23Eng. Abdullah MohsenDone
2619NH07AV23B - G3شاترEng. Ahmed Anwer15.10.2322.10.23Eng. Ahmed AnwerDone
2720NH0179 R3برجولا على الروفEng. Ashraf Sokar24.10.2331.10.23MohamedAnwertill 2/11 to remove violation Done
2821NH07AV 10A - P3Roof pergola violationEng. Ahmed Anwer29.10.2301.11.23Eng. Ahmed Anwerto remove violationDone
2922NH0115 NEW 43تركيب رخام بواجهة الفيلا Eng. Abdullah Mohsen23.10.2306.11.23Eng. Abdullah MohsenDone
3023NH0101 NEW 107لبدء عمل ممشي لفيلا Eng. Abdullah Mohsen03.12.2306.11.23Eng. Abdullah Mohsengot approvalDone
3124NH04RW09A - 17حفر لعمل حمام سباحة بدون موافقاتEng. Abdullah Mohsen06.11.2307.11.23Eng. Abdullah Mohsenما عدا العمل بحمام السباحهDone
3225NH07AV 22B - G2un approved pergola and a glass FenceEng. Ahmed Anwer07.11.2307.11.23Eng. Ahmed Anwerلحين حصول العمل على الموافقاتDone
3326NH05TV09A - 55Binstalled a steel slab & Modification on the External Elevation without approvalsEng. Ahmed Anwer06.11.2308.11.23Eng. Ahmed AnwerDone
3427NH04RT08 - 143CAR SHADEEng. Abdullah Mohsen07.11.2313.11.23Eng. Abdullah MohsenDone
3528NH05 TV09A - 55Bstructure modification & Elevation Modification Eng. Ahmed Anwer09.11.2323.11.23MohamedAnwertill getting apprivalsDone
3629NH04V-B - 34( تكسير ) داخل الفيلا Eng. Abdullah Mohsen12.10.2326.11.23Eng. Ahmed Anwerin approved modifications onlyDone
3730NH02F4 - 04تغير شكل باب الوحدة بتركيب تجاليد خشاب للباب والحائط المحيط له Eng. Abdullah Mohsen29.11.2330.11.23MohamedAnweruntill taking approvalsDone
3831NH04RW 09A-36حفر حمام سباحةEng. Abdullah Mohsen18.11.2305.12.23Eng. Abdullah MohsenAs per Eng. Asraf SokarDone
3932NH04RT08 - 76تكسير بالحوائط داخل الفيلاEng. Abdullah Mohsen18.11.2306.12.23Eng. Abdullah Mohsengot approvalDone
4033NH02B6 - 32تسريب مياه على B622Eng. Abdullah Mohsen03.12.2306.12.23Eng. Abdullah MohsenDone
4134NH05TV08 - 59Bthe locations of the compressors is rejectedEng. Ahmed Anwer06.12.2306.12.23Eng. Ahmed AnwerAs per higher management Done
4235NH0322 NEW 476بدء حفر حمام سباحه Eng. Ahmed Anwer15.12.2307.12.23Eng. Ahmed AnwerDone
4336NH0394 NEW 20تركيب ( مثلث ايرس اعلى الفيلا ) بالالوميتال والزجاج.Eng. Mostafa Mahmoud02.10.2311.12.23Eng. Ahmed AnwerDone
4437NH06RT10 - 94demoloshingEng. Ahmed Anwer28.11.2311.12.23Eng. Ahmed AnwerDone
Stop Work
Cell Formulas
RangeFormula
B8:B44B8=IF($C8<>"",ROW()-ROW($B$7),"")
K8:K44K8=IF(ISBLANK($H8),"Open","Done")
Cells with Conditional Formatting
CellConditionCell FormatStop If True
K8:K373Expression=$H8=""textNO
C22Expression=$C22="NH03"textNO
D22:K22Expression=AND($E$2<>"",ISNUMBER(SEARCH($E$2,$E22)))textNO
C22Cell Value="NH07"textNO
D22:K22Expression=$H22<>""textNO
C22Cell Value="NH06"textNO
C22Cell Value="NH05"textNO
C22Cell Value="NH04"textNO
C22Cell Value="NH02"textNO
C22Cell Value="NH01"textNO
C22Cell Value="NH06"textNO
C22Cell Value="NH05"textNO
C22Cell Value="NH04"textNO
C22Cell Value="NH02"textNO
C22Cell Value="NH01"textNO
C8:C373Expression=$C8="NH03"textNO
D373,D8:K372,F373:K373Expression=AND($E$2<>"",ISNUMBER(SEARCH($E$2,$E8)))textNO
C8:C373Cell Value="NH07"textNO
D373,D8:K372,F373:K373Expression=$H8<>""textNO
I8:I373Expression=ISNUMBER(SEARCH($E$2,$D:$E,1))textNO
C44Cell Value="NH06"textNO
C44Cell Value="NH05"textNO
C44Cell Value="NH04"textNO
C44Cell Value="NH02"textNO
C44Cell Value="NH01"textNO
C8:C373Cell Value="NH06"textNO
C8:C373Cell Value="NH05"textNO
C8:C373Cell Value="NH04"textNO
C8:C373Cell Value="NH02"textNO
C8:C373Cell Value="NH01"textNO
C43,C49Cell Value="NH06"textNO
C43,C49Cell Value="NH05"textNO
C43,C49Cell Value="NH04"textNO
C3:C1048576Cell Value="NH06"textNO
C3:C1048576Cell Value="NH05"textNO
C3:C1048576Cell Value="NH04"textNO
C3:C1048576Cell Value="NH02"textNO
C3:C1048576Cell Value="NH01"textNO
 
Upvote 0
I got it guys like this =SUMPRODUCT(('Stop Work'!$D$8:$D$500=$C10)*('Stop Work'!$K$8:$K$500="Open")*('Stop Work'!$C$8:$C$500=$B$2)*($T10=""))

it was so simple but i ddin't notice that ---- it works now thank you anyway for your usual help
 
Upvote 0
Solution

Forum statistics

Threads
1,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

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