VBA Macro Help - If cell contains a certain word use this formula

alxn

New Member
Joined
Jul 17, 2023
Messages
14
Office Version
  1. 365
  2. 2021
  3. 2013
Platform
  1. Windows
Hello, I need assistance trying to figure out a way in which a formula will run based on a word within a specific column, and populate results in another column.

EX.
In column A if I have the word "Monday" then this formula will run and populate result in another column
If I have the word "Tuesday" then a different formula will run and populate result in the same column as the others

The formula result will all be populated into the same column

Please let me know if this is possible I would greatly appreciate it.
 
OK, not sure why you are being so vague and not wanting to give the details.
The danger in oversimplifying your question is the answer you get may work for your oversimplified example, but not work on your actual data.
I was really hoping that you could show us a realistic example of your data, formulas, and and expected results.
Without that, we can really only give generic answers.

You should be able to use a NESTED IF statement, as described here: IF function – nested formulas and avoiding pitfalls - Microsoft Support.
The formula could get a little long and cumbersome. There may well be simpler solutions, but without knowing the details I have been asking for, it is very hard to know exactly which ones may work in your particular circumstance.
Got it, thank you! I'll try that. Apologies for not being specific.
 
Upvote 0

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
You are welcome.

If you run into issues trying to implement it, please respond back to this ticket with the formula you have attempted to build.
 
Upvote 0
It is 7 different values so lets say Monday-Sunday. Would this still work? I will try it thank you for your input.
It should work. The key is the check for if it's one means the first text in the cell has to be the start of the day, i.e. Monday. If would be a problem if your scenario was there's a sentence in the cell and Monday was a word somewhere in it. But from what you have shown it looks like it will work. Just have to do it 7 times for each day.
 
Upvote 0

Forum statistics

Threads
1,223,099
Messages
6,170,107
Members
452,302
Latest member
TaMere

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top