concatenate cell of certain color

mshunt13

New Member
Joined
Mar 26, 2020
Messages
15
Office Version
  1. 365
Platform
  1. Windows
I have a cell range, G4:AK4, that I would like to concatenate only the cells that are a certain color. The value of the cells are number. I would also like to include a coma between each number.
 
92003516 Eval Testing v2.xlsm
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAPAQARASATAUAVAW
1Incomplete Days17# Entry Days374Compliance Score'1NC Fast'!January
2Incomplete Days Rate4.7%# Errors170% = Full ComplianceGreater than 10% = Non-Compliance with Corrective Action Plan
3Days Present360Error Rate4.5%1% - 10% = Substantial Compliance ZAAACAGNameMonthErrorsMonth
41BRANDONJALESCYIADurhamJAL. B.12345678910111213141516171819202122232425262728293031JAL. B.January2, 5, 6, 7, 8, 12Durham
510Incomplete Days2Entry Days31NC FastAPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP
6Present Days30Emerg Closure Days0Sign In/OutAPPPPPPPPPPPPPPPPPPPPPPPPPPPP
7Inclement Weather Days 0Absent Days1Classroom
8Provider Closure Days0Attendance Errors2 IN         IN                   
9Eval. Attend.A0PPPPPPPPP0PPPPPPPPPPPPPPPPPPP
10Total number of Corrections2Corrections A         A                   
112DEWYAMANIWakeYAM. D.12345678910111213141516171819202122232425262728293031YAM. D.January2, 12Wake
123Incomplete Days1Entry Days23NC FastAPPNSNSPPPPPNSNSPPPPPNSNSPPPPPNSNSPPPPP
13Present Days22Emerg Closure Days0Sign In/OutAPNSNSPPPPPNSPPPPPNSNSPPPPPNSNSPPPPP
14Inclement Weather Days 0Absent Days1Classroom
15Provider Closure Days0Attendance Errors1 IN                             
16Eval. Attend.A0PNSNSPPPPPNSNSPPPPPNSNSPPPPPNSNSPPPPP
17Total number of Corrections1Corrections A                             
Jan 2020
Cell Formulas
RangeFormula
AG3,AC3,Z3:AA3Z3=LEFT(ADDRESS(1,COLUMN(),2),1+(COLUMN()>26))
B4,B11B4=INDIRECT($AA$1&"A"&$A4+1)
D4,D11D4=INDIRECT($AA$1&"C"&$A4+1)
F1F1= SUMIF(D$4:D$1048576,"Entry Days",E$4:E$1048576)
F2F2= SUMIF(D$4:D$1048576,"Attendance Errors",E$4:E$1048576)
F3F3=F2/F1
F4,F11F4=CONCATENATE(LEFT(C4,3),". ",LEFT(B4,1),".")
AS4,AS11AS4=F4
AT4,AT11AT4=$AS$1
AU4,AU11AU4=CONCATENATEbycolor($AK$1,G4:AK4)
AV4,AV11AV4=D4
A4,A11A4=(ROW()-4)/7+1
A5,A12A5=INDIRECT($AA$1&"D"&$A4+1)
G12:AK12,G5:AK5H5=ExtractCap(INDIRECT($AA$1&LEFT(ADDRESS(1,COLUMN(),2),1+(COLUMN()>26))&$A4+1))
I13:Q13,G13,S13:AK13,I6:Q6,G6,S6:AK6S6=S5
C1C1= SUMIF(B$4:B$1048576,"Incomplete Days",C$4:C$1048576)
C2C2=C1/C3
C3C3= SUMIF(B$4:B$1048576,"Present Days",C$4:C$1048576)
C4,C11C4=INDIRECT($AA$1&"B"&$A4+1)
C5,C12C5=COUNTIF(G8:AK8,"IN")
C6,C13C6=COUNTIF(F5:AK5,"P")
C7,C14C7=COUNTIF(F5:AK5,"IW")
C8,C15C8=COUNTIF(F5:AK5,"PC")
E5,E12E5=SUM(C6:C8,E6:E7)
E6,E13E6=COUNTIF(G5:AK5, "EC")
E7,E14E7=COUNTIF(G5:AK5, "A")
E8,E15E8=COUNTIF(G10:AK10, "A")
G15:AK15,G8:AK8G8=IF(G5="","",IF(G5="NE","",IF(G5="IW","",IF(G5="PC","",IF(G5="EC","",IF(G5="PT","",IF(G5="NS","",IF(G5="NB","",IF(G5="A","",IF(AND(G6=""),"IN",""))))))))))
G16:AK16,G9:AK9G9=IF(G5="","",IF(G5="NE","NE",IF(G5="IW","IW",IF(G5="PC","PC",IF(G5="EC","EC",IF(G5="PT","PT",IF(G5="NS","NS",IF(G5="NB","NB",IF(G5="A","A",IF(G6="P","P",IF(G7="P","P",IF(G8="P","P",))))))))))))
G17:AK17,G10:AK10G10=IF(G9="NE","",IF(G9="P","",IF(G9="NB","",IF(G9=G5,"","A"))))
D10,D17D10=COUNTIF(G10:AK10, "A")+COUNTIF(G10:AK10, "PC")+COUNTIF(G10:AK10, "IW")+COUNTIF(G10:AK10, "EC")+COUNTIF(G10:AK10, "NB")+COUNTIF(G10:AK10, "P")+COUNTIF(G10:AK10, "NS")+COUNTIF(G10:AK10, "NE")
Cells with Conditional Formatting
CellConditionCell FormatStop If True
G10:AR10,G17:AR17,G24:AR24,G31:AR31,G38:AR38,G45:AR45,G52:AR52,G59:AR59,G66:AR66,G73:AR73,G80:AR80,G87:AR87,G94:AR94,G101:AR101,G108:AR108,G115:AR115,G122:AR122Expression=SUM(COUNTIF(G10,"*"&Mylist&"*"))textNO
G10:AR10,G17:AR17,G24:AR24,G31:AR31,G38:AR38,G45:AR45,G52:AR52,G59:AR59,G66:AR66,G73:AR73,G80:AR80,G87:AR87,G94:AR94,G101:AR101,G108:AR108,G115:AR115,G122:AR122Cell Valuecontains "A"textNO
 
Upvote 0

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Thanks for the XL2BB. It does, however, raise more questions. You originally said that you wanted to concatenate gray cells but then indicated they were conditionally formatted. This XL2BB sample though only has yellow conditionally formatted cells. So which ones do you want concatenated gray or yellow?

In rows 10 and 17 as shown all the cells that are not yellow are empty so the concatenation would be "" in each case.

Have I mis-interpreted what you ant or have your requirements changed.

Further, you have a CF formula that relates to Mylist but you have told us nothing about what that is and it appears there are no example cells coloured by that rule?
Looking at the formulas in G10:AK10 and G17:AK17 those cells will either be "A" or "" so I'm not sure how Mylist could come into it anyway.

All very confusing I must say.
 
Upvote 0
In the example sent, I had removed the conditional format and was manually coloring fill because that is the only way it was working. Basically I want a formula to concatenate the dates (numbers in the black filled row) for the columns that have an "A" highlighted in yellow.
I have a coworker working on this also. I am not sure how the Mylist is working in this spreadsheet either. I can add the conditional format by in and send it again
 
Upvote 0
In the example sent, I had removed the conditional format and was manually coloring fill ...
Hmm, since it was the Conditional Formatting I was specifically asking about, that wasn't too helpful. ;)


I want a formula to concatenate the dates (numbers in the black filled row) for the columns that have an "A" highlighted in yellow.
I cannot see any "A" values that are not yellow so I assume the requirement is simply to concatenate if the cell contains "A".

mshunt13 2020-04-09 1.xlsm
GHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKAL
412345678910111213141516171819202122232425262728293031
5APPPPPPPPPPPPPPPPPPPPPPPPPPPPPP
6APPPPPPPPPPPPPPPPPPPPPPPPPPPP
7
8ININ
9A0PPPPPPPPP0PPPPPPPPPPPPPPPPPPP
10AA2,12
1112345678910111213141516171819202122232425262728293031
12APPNSNSPPPPPNSNSPPPPPNSNSPPPPPNSNSPPPPP
13APNSNSPPPPPNSPPPPPNSNSPPPPPNSNSPPPPP
14
15IN
16A0PNSNSPPPPPNSNSPPPPPNSNSPPPPPNSNSPPPPP
17A2
Jan 2020
Cell Formulas
RangeFormula
AL10,AL17AL10=TEXTJOIN(",",1,IF(G10:AK10="A",G4:AK4,""))
 
Upvote 0
I tried that already. it gives me a #value! error
There are 3 circumstances that I know of (could be more) that can cause TEXTJOIN to return #VALUE!
- There is already a #VALUE! error in the cells referenced by the formula (eg G4:AK4 and G10:AK10)
- Any of the individual cells trying to be joined (eg G4:AK4) contains more than 255 characters.
- The final result of the TEXTJOIN is longer than 32,767 characters

From what you have posted, none of those things are apparent & as you can see the results with the values you posted work fine since I used your posted values in post #14.

That makes me think that what you have posted is not telling the whole story. Certainly one thing is that your sheet uses a function (ExtractCap) that we don't have and we also obviously do not have the other sheet(s) that your data is extracted from.

Perhaps you can make a small dummy workbook that demonstrates the problem & upload it to DropBox, OneDrive etc and share a link here so that we can take a look to investigate further?
 
Upvote 0
When I enter my formula in that file ('Jan 2020' tab) I get no errors and almost the same result as you.
The only differences between my result and yours are
  • You seem to have missed out on checking column AE in your very long formula, and
  • I did not include a space after the comma in my TEXTJOIN (but it can easily be added in as shown in AU6) below
The full file is provided here: 13 Test Report SHunt v6.xlsm

Cell Formulas
RangeFormula
AS4AS4=F4
AT4AT4=$AN$1
G5:AK5G5=ExtractCap(INDIRECT($AA$1&LEFT(ADDRESS(1,COLUMN(),2),1+(COLUMN()>26))&$A4+1))
AU4AU4=TEXTJOIN(", ",1,IF(G10="A",G4,""),TEXTJOIN(", ",1,IF(H10="A",H4,""),TEXTJOIN(", ",1,IF(I10="A",I4,""),TEXTJOIN(", ",1,IF(J10="A",J4,""),TEXTJOIN(", ",1,IF(K10="A",K4,""),TEXTJOIN(", ",1,IF(L10="A",L4,""),TEXTJOIN(", ",1,IF(M10="A",M4,""),TEXTJOIN(", ",1,IF(N10="A",N4,""),TEXTJOIN(", ",1,IF(O10="A",O4,""),TEXTJOIN(", ",1,IF(P10="A",P4,""),TEXTJOIN(", ",1,IF(Q10="A",Q4,""),TEXTJOIN(", ",1,IF(R10="A",R4,""),TEXTJOIN(", ",1,IF(S10="A",S4,""),TEXTJOIN(", ",1,IF(T10="A",T4,""),TEXTJOIN(", ",1,IF(U10="A",U4,""),TEXTJOIN(", ",1,IF(V10="A",V4,""),TEXTJOIN(", ",1,IF(W10="A",W4,""),TEXTJOIN(", ",1,IF(X10="A",X4,""),TEXTJOIN(", ",1,IF(Y10="A",Y4,""),TEXTJOIN(", ",1,IF(Z10="A",Z4,""),TEXTJOIN(", ",1,IF(AA10="A",AA4,""),TEXTJOIN(", ",1,IF(AB10="A",AB4,""),TEXTJOIN(", ",1,IF(AC10="A",AC4,""),TEXTJOIN(", ",1,IF(AD10="A",AD4,""),TEXTJOIN(", ",1,IF(AF10="A",AF4,""),TEXTJOIN(", ",1,IF(AG10="A",AG4,""),TEXTJOIN(", ",1,IF(AH10="A",AH4,""),TEXTJOIN(", ",1,IF(AI10="A",AI4,""),TEXTJOIN(", ",1,IF(AJ10="A",AJ4,""),TEXTJOIN(", ",1,IF(AK10="A",AK4,"")))))))))))))))))))))))))))))))
AU5AU5=TEXTJOIN(",",1,IF(G10:AK10="A",G4:AK4,""))
AU6AU6=TEXTJOIN(", ",1,IF(G10:AK10="A",G4:AK4,""))
G8:AK8G8=IF(G5="","",IF(G5="NE","",IF(G5="IW","",IF(G5="PC","",IF(G5="EC","",IF(G5="PT","",IF(G5="NS","",IF(G5="NB","",IF(G5="A","",IF(AND(G6=""),"IN",""))))))))))
G9:AK9G9=IF(G5="","",IF(G5="NE","NE",IF(G5="IW","IW",IF(G5="PC","PC",IF(G5="EC","EC",IF(G5="PT","PT",IF(G5="NS","NS",IF(G5="NB","NB",IF(G5="A","A",IF(G6="P","P",IF(G7="P","P",IF(G8="P","P",))))))))))))
G10:AK10G10=IF(G9="NE","",IF(G9="P","",IF(G9="NB","",IF(G9=G5,"","A"))))
 
Upvote 0

Forum statistics

Threads
1,214,812
Messages
6,121,693
Members
449,048
Latest member
81jamesacct

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