We help IT Professionals succeed at work.

# Formula advice on how to return value based on specific text within string

on
941 Views
Hello,

I need my formula to look for specific text and then return a number based on that text. You will see that in A2 I have =IF(ISNUMBER(SEARCH("Weekdays SchHols",A5)),"62") and in B2 I have =IF(ISNUMBER(SEARCH("weekdays",A5)),"42") but these two formulas are working off one value- A5. What I want to be getting is the value of 62 because thatâ€™s what I have specified for Weekdays SchHols but it is picking up Weekdays on its own as well. Is there a way to narrow it down to only provide me with the one value.
In saying this though I need my formula to include all 5 names written in column I with the corresponding value in column J, so if it has Sunday in the range it will return 14, if Saturdays was in the range it would instead return 12.

example.xlsx
Comment
Watch Question
CERTIFIED EXPERT
Top Expert 2008
Commented:
This problem has been solved!
###### Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

Deciding to stick with EE.

Mohamed Asif

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant