Excel Formula

  • Thread starter Thread starter ms.maryw
  • Start date Start date
M

ms.maryw

I am trying to write a formula that will look for information in two
cells and if found will take the information from a 3rd cell. If not
found will leave it blank.

For example:

A1 B2 C2
7560 H55555 This is a test
5678 No data

If A1 contains 7 and B2 contains H use C2 This is a test
If conditions for 7 an H are not met blank.

Thank you
 
Assumes A1 contains a *real* number, not text,
And the "H" in B2 can be *either* upper or lower case.

If the "7" and the "H" *must* be the first characters in the cell, try this:

=IF(AND(--LEFT(A1)=7,LEFT(B2)="H"),C2,"")


If the "7" and the "H" may be *anywhere* within the cell, then try this:

=IF(AND(ISNUMBER(FIND(7,A1)),ISNUMBER(SEARCH("H",B2))),C2,"")

--

HTH,

RD
=====================================================
Please keep all correspondence within the Group, so all may benefit!
=====================================================


I am trying to write a formula that will look for information in two
cells and if found will take the information from a 3rd cell. If not
found will leave it blank.

For example:

A1 B2 C2
7560 H55555 This is a test
5678 No data

If A1 contains 7 and B2 contains H use C2 This is a test
If conditions for 7 an H are not met blank.

Thank you
 
Back
Top