Trouble highlighting row data.

Davio

New Member
Joined
Jun 10, 2014
Messages
36
TABLE1JANUARY
12345678910
TEAM1XXXXX
TEAM2XXXXX
TEAM3XX

<tbody>
</tbody>

TABLE2TASKSTART DATEEND DATE
TEAM1Y1jan3jan
TEAM2X3jan7jan
TEAM3B9jan10jan
TEAM1X7jan8jan

<tbody>
</tbody>
I am having issues with TABLE1 highlighting the start and end dates from TABLE2. My goal is to have the data from TABLE2 visualized in TABLE1 The task data does not factor in to the visualization represented in TABLE1. any help or advice is appreciated.

Thank you.
 
Try this.
1. Clear any previous CF from B5:PK17
2. Select B5:Pk17 and apply the CF shown below.

Excel Workbook
ABCDEFGHIJKLMNOPQRSTUV
416-Jan-1917-Jan-1918-Jan-1919-Jan-1920-Jan-1921-Jan-1922-Jan-1923-Jan-1924-Jan-1925-Jan-1926-Jan-1927-Jan-1928-Jan-1929-Jan-1930-Jan-1931-Jan-1901-Feb-1902-Feb-1903-Feb-1904-Feb-1905-Feb-19
5TEAM1
6TEAM2
7TEAM3
8TEAM4
9
10
11
12
13
17
18
19Team NameSTART DATEEND DATE
20TEAM116-Jan23-Jan
21TEAM223-Jan27-Jan
22TEAM319-Jan10-Feb
23TEAM127-Jan28-Jan
24TEAM417-Jan19-Jan
25TEAM421-Jan21-Jan
26TEAM430-Jan3-Feb
27
Tables (2)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B51. / Formula is =SUMPRODUCT(--($A$20:$A$33=$A5),--($B$20:$B$33<=B$4),--($G$20:$G$33>=B$4))Abc




or, as Toadstool mentioned, it can also be done with COUNTIFS

Excel Workbook
ABCDEFGHIJKLMNOPQRSTUV
416-Jan-1917-Jan-1918-Jan-1919-Jan-1920-Jan-1921-Jan-1922-Jan-1923-Jan-1924-Jan-1925-Jan-1926-Jan-1927-Jan-1928-Jan-1929-Jan-1930-Jan-1931-Jan-1901-Feb-1902-Feb-1903-Feb-1904-Feb-1905-Feb-19
5TEAM1
6TEAM2
7TEAM3
8TEAM4
9
10
11
12
13
17
18
19Team NameSTART DATEEND DATE
20TEAM116-Jan23-Jan
21TEAM223-Jan27-Jan
22TEAM319-Jan10-Feb
23TEAM127-Jan28-Jan
24TEAM417-Jan19-Jan
25TEAM421-Jan21-Jan
26TEAM430-Jan3-Feb
27
Tables (3)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B51. / Formula is =COUNTIFS($A$20:$A$33,$A5,$B$20:$B$33,"<="&B$4,$G$20:$G$33,">="&B$4)Abc
 
Upvote 0

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Davio,

Having let @Peter_SSs do all the legwork I wonder if I should swoop in with a slightly different flavor of my original formula?
Edit: Ha! I missed swooping by 2 minutes :)

If I select B5 to PK17, Conditional Format and the formula
=IF(COUNTIFS($A$19:$A$33,$A5,$B$19:$B$33,"<="&B$4,$G$19:$G$33,">="&B$4) > 0,TRUE)
then it highlights the cells with the chosen format where I show H because I can't display cell Fills in this editor.


ABCDEFGHI
3TABLE 1
415-Jan-1916-Jan-1917-Jan-1918-Jan-1919-Jan-1920-Jan-1921-Jan-1922-Jan-19
5TEAM 1H
H
H
H
H
6TEAM 2H
H
H
7TEAM 3H
8
18TeamStart DateEnd Date
19TEAM 116 Jan18 Jan
20TEAM 217 Jan19 Jan
21TEAM 321 Jan21 Jan
22TEAM 120 Jan21 Jan

<tbody>
</tbody>

 
Last edited:
Upvote 0
Would it be possible to add text within the highlighted area using the same formula? The text would be referenced from L17:L33.
 
Last edited:
Upvote 0
Would it be possible to add text within the highlighted area using the same formula? The text would be referenced from L17:L33.
We should have started there as, if doing that, the conditional formatting becomes extremely simple - see below. :cool:
Formula in B5 is copied across and down.
Remove the old CF and apply this one.

Excel Workbook
ABCDEFGHIJKLMNOPQRSTU
416-Jan-1917-Jan-1918-Jan-1919-Jan-1920-Jan-1921-Jan-1922-Jan-1923-Jan-1924-Jan-1925-Jan-1926-Jan-1927-Jan-1928-Jan-1929-Jan-1930-Jan-1931-Jan-1901-Feb-1902-Feb-1903-Feb-1904-Feb-19
5TEAM1AAAAAAAADD
6TEAM2BBBBB
7TEAM3CCCCCCCCCCCCCCCCC
8TEAM4EEEFGGGGG
9
10
11
12
13
17
18
19Team NameSTART DATEEND DATE
20TEAM116-Jan23-JanA
21TEAM223-Jan27-JanB
22TEAM319-Jan10-FebC
23TEAM127-Jan28-JanD
24TEAM417-Jan19-JanE
25TEAM421-Jan21-JanF
26TEAM430-Jan3-FebG
27
Tables (4)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B51. / Formula is =B5<>""Abc
 
Last edited:
Upvote 0
We should have started there as, if doing that, the conditional formatting becomes extremely simple - see below. :cool:
Formula in B5 is copied across and down.
Remove the old CF and apply this one.

Tables (4)

ABCDEFGHIJKLMNOPQRSTU
4 16-Jan-1917-Jan-1918-Jan-1919-Jan-1920-Jan-1921-Jan-1922-Jan-1923-Jan-1924-Jan-1925-Jan-1926-Jan-1927-Jan-1928-Jan-1929-Jan-1930-Jan-1931-Jan-1901-Feb-1902-Feb-1903-Feb-1904-Feb-19
5TEAM1AAAAAAAA DD
6TEAM2 BBBBB
7TEAM3 CCCCCCCCCCCCCCCCC
8TEAM4 EEE F GGGGG
9
10
11
12
13
17
18
19Team NameSTART DATE END DATE
20TEAM116-Jan 23-Jan A
21TEAM223-Jan 27-Jan B
22TEAM319-Jan 10-Feb C
23TEAM127-Jan 28-Jan D
24TEAM417-Jan 19-Jan E
25TEAM421-Jan 21-Jan F
26TEAM430-Jan 3-Feb G
27

<colgroup><col style="font-weight:bold; width:30px; "><col style="width:89px;"><col style="width:99px;"><col style="width:75px;"><col style="width:75px;"><col style="width:75px;"><col style="width:75px;"><col style="width:84px;"><col style="width:75px;"><col style="width:75px;"><col style="width:75px;"><col style="width:75px;"><col style="width:75px;"><col style="width:75px;"><col style="width:75px;"><col style="width:75px;"><col style="width:75px;"><col style="width:75px;"><col style="width:77px;"><col style="width:77px;"><col style="width:77px;"><col style="width:77px;"></colgroup><tbody>
</tbody>

Spreadsheet Formulas
CellFormula
B5=IFERROR(INDEX($L$20:$L$33,AGGREGATE(15,6,(ROW($L$20:$L$33)-ROW($L$20)+1)/(($A$20:$A$33=$A5)*($B$20:$B$33<=B$4)*($G$20:$G$33>=B$4)),1)),"")

<tbody>
</tbody>

<tbody>
</tbody>

Conditional formatting
CellNr.: / ConditionFormat
B51. / Formula is =B5<>""Abc

<tbody>
</tbody>

<tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4

Peter,

Based on the new formula, is it possible to accomplish the following?

1. Have the text appear across the highlighted cells shown in example B. The "( )" are to simulate the highlighted range
Example A: Shows a letter in each cell of the highlighted range.
A B C D E F G H I
TEAM1 (C C C C C)

Example B: Shows one letter across the highlighted range.
A B C D E F G H I
TEAM1 ( C )


2. Can I assign different colors to each team according to the team number? eg. TEAM1=BLUE, TEAM2=YELLOW, TEAM3=RED?

 
Upvote 0
Best not to fully quote long posts as it makes the thread harder to read/navigate. If you want to quote, quote small, relevant parts only.



Based on the new formula, is it possible to accomplish the following?

1. Have the text appear across the highlighted cells shown in example B.
A formula cannot merge cells if that is what you mean. It may be possible to just have the letter appear in a single cell at the centre of the range (or near the centre for ranges with an even number of cells). However, if you do that, the conditional formatting would have to go back to one of the much more complicated versions we looked at before.


2. Can I assign different colors to each team according to the team number?
You could, provided ...
- The team names are already in column A and
- You manually set up a different CF for each row based on that team name in column A.

This scenario, using worksheet formulas and conditional formatting seems not very practical to me. I think the result could be achieved if you were to use vba code instead of worksheet formulas and conditional formatting. Of course you or your other users would have to have macros enabled for that to occur. Or you just stick with one of the results so far.
 
Upvote 0
Best not to fully quote long posts as it makes the thread harder to read/navigate. If you want to quote, quote small, relevant parts only.



A formula cannot merge cells if that is what you mean. It may be possible to just have the letter appear in a single cell at the centre of the range (or near the centre for ranges with an even number of cells). However, if you do that, the conditional formatting would have to go back to one of the much more complicated versions we looked at before.

Which variable in the formula will I need to adjust to have the text show within the highlighted range?


You could, provided ...
- The team names are already in column A and
- You manually set up a different CF for each row based on that team name in column A.

This scenario, using worksheet formulas and conditional formatting seems not very practical to me. I think the result could be achieved if you were to use vba code instead of worksheet formulas and conditional formatting. Of course you or your other users would have to have macros enabled for that to occur. Or you just stick with one of the results so far.

I want to keep this simple and stay away from VBA if possible.
 
Upvote 0

Forum statistics

Threads
1,214,885
Messages
6,122,090
Members
449,065
Latest member
Danger_SF

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