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
 
Peter_SSs you are a living legend, thank you very much.
So that worked well with the formula i applied as =SUMPRODUCT((Table1[Type]="Scheduled")*(X14:X108=1))

If change it to X201 from X108 (there is no data in the corresponding cells yet, scheduled or unscheduled) and highlighted cells to count, i get the error N/A, I am guessing because there is no data to count.

Is there a way for the formula to disregard the empty cells and still count what is there, for example where it should count and display a 2 it displays N/A if you hover the mouse over the hashtag filled cell.
 
Upvote 0

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
=SUMPRODUCT((Table1[Type]="Scheduled")*(X14:X108=1))
That is a different scenario:
  • You are now dealing with a formal table structure, that was not apparent before.
  • The range with 1's that you are now checking is a single column. That was not the case before.
I would probably be using a different (more efficient) formula for the count if that is the circumstance.

In any case I'm not sure I understand the issue well enough to test a suggestion. Can you make a smaller example (10-15 rows not 100) and post that with XL2BB and explain again in relation to that sample?
 
Upvote 0
That is a different scenario:
  • You are now dealing with a formal table structure, that was not apparent before.
  • The range with 1's that you are now checking is a single column. That was not the case before.
I would probably be using a different (more efficient) formula for the count if that is the circumstance.

In any case I'm not sure I understand the issue well enough to test a suggestion. Can you make a smaller example (10-15 rows not 100) and post that with XL2BB and explain again in relation to that sample?
So sorry for the confusion, I confuse myself!

The count of the completed and failed from the colored cells works great and will count if additional rows are added.

The Scheduled and Unscheduled count needs to come from the Type column and match the dates above the colored cells, so a different sheet in the workbook can pull data for the date, ie 1/4/23.

So for the minisheet in this reply, scheduled would display 0, 0, 1, 2, 0 and unscheduled would display 1, 2, 1, 0, 0, this working off of either the received date or start date.

I would like the count for the scheduled and unscheduled to include rows that are added when more data is input.

The area that is displaying the count will be hidden off to the right hand side of the colored cells, as a referencing point for another sheet in the workbook for that to self populate.

I hope this all makes sense.

minisheet.xlsx
BCDEFGHIJKLMNOPQRST
4Completed102330Completed
511232Failed
6Failed2#N/AScheduled
7April1-Apr-23#N/AUnscheduled
812345678910111213
9TypeStatusRecieved DateStart DateEnd DateRTPSSMTWTFSSMTWT
10UnscheduledCompleted1/4/232/4/234/4/232111 
11UnscheduledCompleted2/4/232/4/233/4/23 11  
12UnscheduledNot Completed3/4/235/4/23  222
13ScheduledNot Completed4/4/234/4/23   2 
14ScheduledCompleted3/4/234/4/23  11 
15ScheduledCompleted4/4/234/4/23   1 
16UnscheduledNot Completed2/4/235/4/23 2222
17
Gantt Chart
Cell Formulas
RangeFormula
O4O4=COUNTIFS(I10:I20, L4)
P4P4=COUNTIFS(J10:J20, L4)
Q4Q4=COUNTIFS(K10:K20, L4)
R4R4= COUNTIFS(L10:L20, L4)
O5O5=COUNTIFS(I10:I20, L6)
P5P5=COUNTIFS(J10:J20, L6)
Q5Q5=COUNTIFS(K10:K20, L6)
R5R5= COUNTIFS(L10:L20, L6)
H7H7=H8
N4N4=COUNTIFS(H10:H20, L4)
N5N5=COUNTIF(H10:H20, L6)
N6N6=SUMPRODUCT((Table1[Type]="Scheduled")*(H10:H16=1))
N7N7=SUMPRODUCT((Table1[Type]="Unscheduled")*(H10:H16=1))
H8H8=G7
I8:T8I8=H8+1
H9:T9H9=LEFT(TEXT(H8,"ddd"),1)
H10:L16H10=IF(AND(H$8>=$E10,H$8<=$F10),1,IF(AND(H$8>=$D10,OR(H$8<=$E10,H$8<=$G10),ISNUMBER($D10)),2,""))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
AN10:AS10,H10:AL10,H11:AP34Expression=AND(H$8>=$E10,H$8<=$F10)textNO
AN10:AS10,H10:AL10,H11:AP34Expression=AND(H$8>=$D10,OR(H$8<=$E10,H$8<=$G10),ISNUMBER($D10))textNO
Cells with Data Validation
CellAllowCriteria
G7List=$AQ$9:$AQ$20
 
Upvote 0
Still a bit hard to see what is the table and what is not, but does this do what you want for 'Completed' counts of Scheduled and Unscheduled?

Stef9910.xlsm
BCDEFGHIJKLMNOPQRS
4Completed1
5
6Failed200120Scheduled
7April01-Apr-2302210Unscheduled
8123456
9TypeStatusRecieved DateStart DateEnd DateRTPSSMTWT
10UnscheduledCompleted1/4/232/4/234/4/232111
11UnscheduledCompleted2/4/232/4/233/4/2311
12UnscheduledNot Completed3/4/235/4/23222
13ScheduledNot Completed4/4/234/4/232
14ScheduledCompleted3/4/234/4/2311
15ScheduledCompleted4/4/234/4/231
16UnscheduledNot Completed2/4/235/4/232222
17
18
Sheet4
Cell Formulas
RangeFormula
N6:R7N6=COUNTIFS(Table1[[Type]:[Type]],$S6,OFFSET(Table1[[Type]:[Type]],0,5+COLUMNS($H:H)),$L$4)
 
Upvote 0
Once again Peter_SSs, you have amazed me, thanks you so much,

I have been attempting it myself since posting on here and came up with,

=COUNTIFS(Table1[[#All], [Type]], "*Scheduled*", Table1[[#All],[Start Date]],AB13)
=COUNTIFS(Table1[[#All], [Type]], "*Unscheduled*", Table1[[#All],[COPP/Admission Date]], AB13)

The cell ranges are different due to working within the actual spreadsheet.

I will be using your formula, as i know it will work better.

Once again, thank you for your time and patience with me.
 
Upvote 0
I have been attempting it myself since posting on here and came up with,

=COUNTIFS(Table1[[#All], [Type]], "*Scheduled*", Table1[[#All],[Start Date]],AB13)
That will not work because "Scheduled" is also found within "Unscheduled".
For example, if I have understood correctly, for this sample data the result should be zero, but it is returning 2 due to the issue I mentioned above.

Stef9910.xlsm
BCDEFGVAB
9TypeStatusRecieved DateStart DateEnd DateRTP
10UnscheduledCompleted1/4/232/4/234/4/23
11UnscheduledCompleted2/4/232/4/233/4/232
12UnscheduledNot Completed3/4/235/4/23
13ScheduledNot Completed4/4/234/4/232/04/2023
14ScheduledCompleted3/4/234/4/23
15ScheduledCompleted4/4/234/4/23
16UnscheduledNot Completed2/4/235/4/23
17
Sheet4
Cell Formulas
RangeFormula
AB11AB11=COUNTIFS(Table1[[#All], [Type]], "*Scheduled*", Table1[[#All],[Start Date]],AB13)
 
Upvote 0
So sorry to bother again, how would i add an addition search criteria to =COUNTIFS(Table1[[Type]:[Type]],$S6,OFFSET(Table1[[Type]:[Type]],0,5+COLUMNS($H:H)),$L$4)

Table1[[Region]:[Region]] with the word Metro that is located in $T6 this is if it was added to the above minisheet.

The formula from my spreadsheet is

=COUNTIFS(Table1[[Type]:[Type]],$BL3,Table1[[Region]:[Region]],$BK1,OFFSET(Table1[[Type]:[Type]],0,5+COLUMNS($Y:Y)),$AU$3)

$BL3 is where the word Scheduled is located
$BK1 is where the word Metro is located
$AU$3 is where the 1 is located for completed

I have checked all the data for incorrect dates and spellings and all is correct, but the above formula i have used returns the word January.

Any ideas?

Your help is always very appreciated, thank you.
 
Upvote 0
So sorry to bother again, how would i add an addition search criteria to =COUNTIFS(Table1[[Type]:[Type]],$S6,OFFSET(Table1[[Type]:[Type]],0,5+COLUMNS($H:H)),$L$4)

Table1[[Region]:[Region]] with the word Metro that is located in $T6 this is if it was added to the above minisheet.

The formula from my spreadsheet is

=COUNTIFS(Table1[[Type]:[Type]],$BL3,Table1[[Region]:[Region]],$BK1,OFFSET(Table1[[Type]:[Type]],0,5+COLUMNS($Y:Y)),$AU$3)

$BL3 is where the word Scheduled is located
$BK1 is where the word Metro is located
$AU$3 is where the 1 is located for completed

I have checked all the data for incorrect dates and spellings and all is correct, but the above formula i have used returns the word January.

Any ideas?

Your help is always very appreciated, thank you.
=COUNTIFS(Table1[[Type]:[Type]],$BL3,Table1[[Region]:[Region]],$BK1,OFFSET(Table1[[Type]:[Type]],0,5+COLUMNS($Y:Y)),$AU$3) is no longer returning the word January but is returning a 0 when it should count 2

I had accidentally put the formula in a hidden part of the conditional formatted gantt chart.
 
Upvote 0

Forum statistics

Threads
1,224,827
Messages
6,181,194
Members
453,021
Latest member
pingpong7117

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