Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to write this Excel in-cell formula "properly" and more compact?

Checking per row if column D = true, then returning as string the corresponding cells in column B and C.

I can write the below manually just fine, but it’s not great for adding extra rows later and I know there has to be a better way to do it, I just don’t know what phrase to search for to help me find out.

[...]
&if(D10=true(),B10&": "&C10&char(10),"")
&if(D11=true(),B11&": "&C11&char(10),"")
&if(D12=true(),B12&": "&C12&char(10),"")
&if(D13=true(),B13&": "&C13&char(10),"")
&if(D14=true(),B14&": "&C14&char(10),"")
[...]

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

The following should work:

=TEXTJOIN(CHAR(10), TRUE, IF(D10:D14=TRUE, B10:B14 & ": " & C10:C14, ""))
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading