Forum Discussion
NicoleM360
Apr 19, 2023Copper Contributor
HELP WITH FORMULAS AND RULES
I'm trying to create a formula that will take the value in cell A and create a value in cell D so if cell A is a number then Cell D will read a specific line of text such as "Does Not Release", if cell A is a number with an * then Cell D will read a different line of test such as "Not Listed" and if cell A has letters such as N/A then the value in cell D will be the same N/A. The other thing I'm trying to do is if cell A has a value of N/A then cells B and C will have a strikethrough. Are either of these possible? I was able to do the first part of if cell A is true then Cell D will read "Does Not Release" using the IFS formula.
What I'm trying to do is create functionality for a template my team uses so it eliminates errors. I've already used the XLookup to have values in column a of tab 1 reflect their value in a corresponding column on tab 2
3 Replies
Sort By
- NikolinoDEGold Contributor
You can use a combination of the IF and OR functions to achieve the first part of your goal. Here’s an example formula that you can use in cell D1 to check the value in cell A1 and return the corresponding text:
=IF(ISNUMBER(A1),"Does Not Release",IF(OR(A1="N/A",A1="n/a"), "N/A", IF(ISNUMBER(SEARCH("*",A1)), "Not Listed", "")))
This formula first checks if the value in cell A1 is a number using the ISNUMBER function. If it is, the formula returns the text “Does Not Release”. If the value in cell A1 is not a number, the formula then checks if it is equal to “N/A” or “n/a” using the OR function. If it is, the formula returns “N/A”. If the value in cell A1 is not equal to “N/A” or “n/a”, the formula then checks if it contains an asterisk (*) using the SEARCH function. If it does, the formula returns the text “Not Listed”. If none of these conditions are met, the formula returns an empty string (“”).
To apply strikethrough formatting to cells B1 and C1 if the value in cell A1 is “N/A” or “n/a”, you can use conditional formatting.
Here’s how you can do this:
- Select cells B1 and C1.
- Click on the “Home” tab in the ribbon.
- Click on the “Conditional Formatting” button and choose “New Rule”.
- In the “New Formatting Rule” dialog box, choose “Use a formula to determine which cells to format”.
- In the formula field, enter =OR($A1="N/A",$A1="n/a").
- Click on the “Format” button and choose the “Font” tab.
- Check the “Strikethrough” option and click on “OK”.
- Click on “OK” again to apply the conditional formatting rule.
This will apply strikethrough formatting to cells B1 and C1 if the value in cell A1 is equal to “N/A” or “n/a”.
I hope this helps!
I know I don't know anything (Socrates)
- NicoleM360Copper Contributor
NikolinoDE Thank you so much! This is perfect and works amazingly well!
- NikolinoDEGold ContributorI am glad that I could help you.
I wish you continued success with Excel!