Forum Discussion
Laura Cheeping
Apr 04, 2018Copper Contributor
Excel Formula - formula based on if cell contains
Please help! I am trying to create a formula that will do the following: If cell B2 contains "Inbound" then return data in cell D2, if cell B2 contains "Outbound" then return data in cell C2.
Co...
- Apr 04, 2018This formula will do the job
=IF(ISNUMBER(SEARCH("Inbound",B2)),D2,IF(ISNUMBER(SEARCH("Outbound",B2)),C2,""))
Haytham Amairah
Apr 04, 2018Silver Contributor
Hi Laura,
The second formula is what you are looking for, it's should work just fine!
But you have to change the cell references inside the formula from B3, D3, and C3 to B2, D2, and C2 as follows:
=IF(B2="Inbound",D2,IF(B2="Outbound",C2,""))
Hope that helps