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

excel check for certain text and output value

I want to check for a certain piece of text in a cell and output its corresponding value.

A B C D
1 T1 45
2 T2 34
3 R1 75
4 R2 75

The idea is that in column D it outputs the value of C depending if B contains a "T" or an "R"

Later on, I want to calculate with these values.

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

Hope this makes sense.

>Solution :

As per your given conditions and the data sample in the OP, the following should work.

enter image description here


• Formula used in cell D1

=IF(OR(LEFT(B1)={"T","R"}),C1,"")

Using dynamic array formulas:

enter image description here


• Formula used in cell D1

=MAP(B1:B4,C1:C4,LAMBDA(α,φ,IF(OR(LEFT(α)={"T","R"}),φ,"")))

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