If cell contains a specific character, then TRUE, if not, then FALSE

megera716

Board Regular
Joined
Jan 3, 2013
Messages
139
Office Version
  1. 365
Platform
  1. Windows
This seems like an exceedingly simple problem but I'm having trouble applying my Google results to my situation.

I have a table full of sales data, with Invoice Numbers in Column C. In a formula I've got way over in Column X, I just want to say if Column C contains "A", "B", "C" or "D" is true, run one formula and if it it's false, run a different one. I've already got those formulas and don't need help with that, just how to write the logical test.

A lot of what I found on Google was checking a range for a value in a different cell but I don't have it set up that way and don't really want to.
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Try:

=IF(OR(C13={"A","B","C","D"}),TRUE,FALSE)

Put formula1 where TRUE is, and the other where FALSE is. If you have the letter contained within a larger string like "123-A", we can use a SEARCH option.

Also, this is an Excel formula, I don't know if it will work on Google.
 
Upvote 0
How about
Excel Formula:
=IF(OR(C2={"a","b","c","d"}),formula1,formula2)
Beaten 2it again.:(
 
Upvote 0
Thank you @Eric W ! I notice the curly brackets in the middle there, is this an array formula that I need to do Ctrl-Shift-Enter? Also, I just meant my Google results had not been helpful but I am using Excel, not Google Sheets or anything. :)

This is my bad for not being clear in my OP, but I need to know if the cell contains those letters, but it will definitely have other data in it too. A few example invoice numbers:
17237
17192A
17238
17241B
etc.

The formula as written would only return something if the A, B, C or D is the only thing in that cell, yes?
 
Upvote 0
Do you just want to check if the last character is not a number?
 
Upvote 0
Ok how about
Excel Formula:
=IF(ISERROR(RIGHT(C2)+0),formula1,formula2)
 
Upvote 0
T202009c.xlsm
BC
217237FALSE
317192ATRUE
417238FALSE
517241BTRUE
65ZFALSE
7
3b
Cell Formulas
RangeFormula
C2:C6C2=OR(RIGHT(B2)={"a","b","c","d"})

Dave, this was perfect! @Fluff, yours also returned the desired result :), for the most part. However, sometimes we have invoice numbers that end with R (for Revised, if we needed to change it after the initial send) and the formula captured those too, which I don't want it to do in this case.

Thank you both!
 
Upvote 0
That's why I asked "Do you just want to check if the last character is not a number?" ;)

Glad your sorted & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,808
Messages
6,121,684
Members
449,048
Latest member
81jamesacct

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