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

Hello,

Can someone please help me? I have attached an example of what I am working on.
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.

Can someone please help me out and let me know how I would go about solving this?

example.xlsx
vegas86Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

zorvek (Kevin Jones)ConsultantCommented:
You will probably need to make the formulas more dependent on each other.

See attached.

Kevin
Q-26946372.xlsx
vegas86Author Commented:
Hi Zorvek,

Thanks for your suggestion it works well but unfortunately I can’t do that in this situation, I only included two formulas as an example. My real sheet only has one formula and within that formula I need it to include all 5 ranges so that when a selection is made from a data validation list in column A the formula will automatically return the correct number value in column B.

Thanks though!
zorvek (Kevin Jones)ConsultantCommented:
Use this single formula then:

=IF(ISNUMBER(SEARCH("Weekdays SchHols",A5)),"62",IF(ISNUMBER(SEARCH("Weekdays",A5)),"42",IF(ISNUMBER(SEARCH("Sundays",A5)),"14",IF(ISNUMBER(SEARCH("Saturdays",A5)),"12",IF(ISNUMBER(SEARCH("Weekday Holidays",A5)),"62",0)))))

Kevin

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
vegas86Author Commented:
Just tried it then and it's fantastic, thanks for your help and time Kevin!! I appreciate it!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.