Displaying a 1 in conditional formatting rules

Stef9910

Board Regular
Joined
Nov 2, 2022
Messages
72
Office Version
  1. 2010
Platform
  1. Windows
Hello all,

I have received some fantastic help from awoohaw, PeteWright and fluff in recent days and one more problem to conquer.

Is it possible to add to the conditional format rules, =AND(N$62>=$B64,N$62<=$D64,ISNUMBER($B64)) to have the number 1 appear in the cells?

This is so I can total the number cells that display the number 1 throughout the spreadsheet.

Your help will be greatly received.

Thank you

Stefan
 
Is it possible to add to the conditional format rules, =AND(N$62>=$B64,N$62<=$D64,ISNUMBER($B64)) to have the number 1 appear in the cells?

This is so I can total the number cells that display the number 1 throughout the spreadsheet.
Getting back to your original question now that we have a bit more information: If you don't have other values/formulas in the X15 to BF157 range, then you could put this formula in X16 and copy it to other cells in that range.
Note that I have used @arthurbr's combined formula in my conditional formatting (and in the worksheet formulas producing the "1" values.

Cell Formulas
RangeFormula
X15:AC25X15=IF(OR(AND(X$13>=$N15,X$13<=$P15),AND(X$13>=$L15,OR(X$13<=$N15,X$13<=$R15),ISNUMBER($L15))),1,"")
Cells with Conditional Formatting
CellConditionCell FormatStop If True
X15:AC25Expression=AND(X$13>=$L15,OR(X$13<=$N15,X$13<=$R15),ISNUMBER($L15))textNO
X15:AC25Expression=AND(X$13>=$N15,X$13<=$P15)textNO
 
Upvote 0
Solution

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
@Stef9910 ,
Just to add one more thing into all of this.
If you want to present the worksheet with the "1"s hidden you can also change the font in the conditional formatting to match the cell color. You would still be able to do arithmetic with the cells, but they would not be seen on the cell grid.
 
Upvote 0
That's amazing and solves my problem, thank you so so much Peter_SSs, arthurbr and awoohaw
 
Upvote 0
You're welcome. Glad we could help. Thanks for the follow-up. :)
 
Upvote 0
You're welcome. Glad we could help. Thanks for the follow-up. :)
Hi ya, it's the thick Aussie here again, found another problem!!

How would i make the formula you done, =IF(OR(AND(X$13>=$N15,X$13<=$P15),AND(X$13>=$L15,OR(X$13<=$N15,X$13<=$R15),ISNUMBER($L15))),1,"")
display a 1 for the green cells and a 2 for the red cells?

at the top of the spreadsheet i have one green cell with a 1 in it which i am using a referencing cell to count the 1's using =COUNTIF(X15:X109, AT3) AT3 being the green cell with a 1 in it.

The red cell at AT5 has a 2 in it, i would like to count the red cells with 2 in it.

Is it possible to make the above formula place a 1 in the green cells for X$13>=$N15,X$13<=$P15 part of the formula and a 2 for the X$13<=$N15,X$13<=$R15 part of the formula?

Thank you
 
Upvote 0
How would i make the formula ...
display a 1 for the green cells and a 2 for the red cells?
Try

Cell Formulas
RangeFormula
X15:AC25X15=IF(AND(X$13>=$N15,X$13<=$P15),1,IF(AND(X$13>=$L15,OR(X$13<=$N15,X$13<=$R15),ISNUMBER($L15)),2,""))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
X15:AC25Expression=AND(X$13>=$L15,OR(X$13<=$N15,X$13<=$R15),ISNUMBER($L15))textNO
X15:AC25Expression=AND(X$13>=$N15,X$13<=$P15)textNO
 
Upvote 0
Try

Cell Formulas
RangeFormula
X15:AC25X15=IF(AND(X$13>=$N15,X$13<=$P15),1,IF(AND(X$13>=$L15,OR(X$13<=$N15,X$13<=$R15),ISNUMBER($L15)),2,""))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
X15:AC25Expression=AND(X$13>=$L15,OR(X$13<=$N15,X$13<=$R15),ISNUMBER($L15))textNO
X15:AC25Expression=AND(X$13>=$N15,X$13<=$P15)textNO
Thankyou Peter_SSs,that worked brilliantly,

So I have one last thing to work out and then hopefully I am done!

From the highlighted cells that has been counted, I would like to count if they Scheduled or Unscheduled, would this be possible?

minisheet.xlsx
BCDEFGIJKLMN
41Faciltated
5
62Not Facilitated
7April1-Apr-23
8123456
9TypeStatusRecieved DateStart DateEnd DateRTPSSMTWT
10UnscheduledCompleted31/3/231/4/2330/4/23111111
11UnscheduledCompleted29/3/2330/3/2320/4/23111111
12UnscheduledCompleted2/4/232/4/2330/4/23 11111
13UnscheduledCompleted2/4/232/4/234/4/23 111  
14ScheduledCompleted3/4/234/4/23  11  
15ScheduledCompleted4/4/234/4/23   1  
16UnscheduledCompleted4/4/234/4/237/4/23   111
17ScheduledCompleted5/4/236/4/23    11
18UnscheduledNot Completed5/4/235/4/23    2 
19UnscheduledNot Completed5/4/235/4/23    2 
20UnscheduledCompleted5/4/237/4/2330/4/23    22
21UnscheduledCompleted3/4/234/4/235/4/23  211 
22UnscheduledNot Completed5/4/2310/4/23    22
23UnscheduledNot Completed5/4/235/4/23    2 
24UnscheduledNot Completed6/4/236/4/23     2
25UnscheduledNot Completed7/4/237/4/23      
26UnscheduledCompleted8/4/238/4/2310/4/23      
27UnscheduledNot Completed8/4/238/4/23      
28UnscheduledCompleted9/4/2310/4/2312/4/23      
29ScheduledCompleted11/4/2311/4/23      
30ScheduledNot Completed6/4/236/4/23     2
31ScheduledCompleted11/4/2311/4/23      
32UnscheduledCompleted11/4/2312/4/23      
33ScheduledCompleted20/4/2320/4/23      
34UnscheduledCompleted14/4/2314/4/232/5/23      
3524586Completed
36700105Failed
37180Scheduled
380Unscheduled
39
Hospital Sit Gantt Chart
Cell Formulas
RangeFormula
I7I7=I8
J8:N8J8=I8+1
I9:N9J9=LEFT(TEXT(J8,"ddd"),1)
I10:N34J10=IF(AND(J$8>=$E10,J$8<=$F10),1,IF(AND(J$8>=$D10,OR(J$8<=$E10,J$8<=$G10),ISNUMBER($D10)),2,""))
J35J35=COUNTIFS(J10:J34, Q4)
K35K35=COUNTIFS(K10:K34, Q4)
L35L35=COUNTIFS(L10:L34, Q4)
M35M35=COUNTIFS(M10:M34, Q4)
J36J36=COUNTIFS(J10:J34, Q6)
K36K36=COUNTIFS(K10:K34, Q6)
L36L36=COUNTIFS(L10:L34, Q6)
M36M36=COUNTIFS(M10:M34, Q6)
B36B36=COUNTIF(Table1[Type],"Scheduled")
B37B37=COUNTIF(Table1[Type],"Unscheduled")
I8I8=G7
I35I35=COUNTIFS(I10:I34, Q4)
I36I36=COUNTIF(I10:I34, Q6)
I37I37=COUNTIF(I10:I34, B36)
I38I38=COUNTIF(I10:I34, B37)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
AO10:AT10,I10:AM10,I11:AQ34Expression=AND(I$8>=$E10,I$8<=$F10)textNO
AO10:AT10,I10:AM10,I11:AQ34Expression=AND(I$8>=$D10,OR(I$8<=$E10,I$8<=$G10),ISNUMBER($D10))textNO
Cells with Data Validation
CellAllowCriteria
G7List=$AR$9:$AR$20
 
Upvote 0
Try formulas like
Excel Formula:
=SUMPRODUCT((B10:B34="Scheduled")*(I10:N34=1))
 
Upvote 0

Forum statistics

Threads
1,223,910
Messages
6,175,320
Members
452,635
Latest member
laura12345

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