Compare String and Return Value

Pestomania

Active Member
Joined
May 30, 2018
Messages
292
Office Version
  1. 365
Platform
  1. Windows
I have been trying to identify how to compare a string and return if it is latest version. I have a large amount of data that looks like:

I have a column of "data" that has a letter at the end of the string. If it is a letter, the largest letter (F>A) is the latest revision. If there is a data point with no letter, but the precursor has a letter, it is obsoleted. (i.e. Route 921 and Route 921 A. Route 921 A is the latest and Route 921 is obsolete.)

Sage Tables Created 2023-09-19.xlsx
AHAI
1DataLatest Rev?
4Route 1234 ANo
5Route 1234 BYes
9Route 1234No
10Route 5567 DNo
14Route 5567 FYes
15Route 921 ANo
16Route 921No
17Route 921 FYes
FMI - Route Tool Code Upload 9-
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
I have been trying to identify how to compare a string and return if it is latest version. I have a large amount of data that looks like:

I have a column of "data" that has a letter at the end of the string. If it is a letter, the largest letter (F>A) is the latest revision. If there is a data point with no letter, but the precursor has a letter, it is obsoleted. (i.e. Route 921 and Route 921 A. Route 921 A is the latest and Route 921 is obsolete.)

Sage Tables Created 2023-09-19.xlsx
AHAI
1DataLatest Rev?
4Route 1234 ANo
5Route 1234 BYes
9Route 1234No
10Route 5567 DNo
14Route 5567 FYes
15Route 921 ANo
16Route 921No
17Route 921 FYes
FMI - Route Tool Code Upload 9-


I just noticed, I provided backwards information.

If it does not have a letter, it is a higher revision (more recent).
 
Upvote 0
If it does not have a letter, it is a higher revision (more recent).

In that case:
Book1
AB
1DataLatest Rev?
2Route 1234 ANo
3Route 1234 BNo
4Route 1234Yes
5Route 5567 DNo
6Route 5567 FNo
7Route 921 ANo
8Route 921Yes
9Route 921 FNo
Sheet2
Cell Formulas
RangeFormula
B2:B9B2=IF(LEN(A2)-LEN(SUBSTITUTE(A2," ",""))=1,"Yes","No")
 
Upvote 0
Also:

Book2
AB
1DataLatest Rev?
2Route 1234 ANo
3Route 1234 BNo
4Route 1234Yes
5Route 5567 DNo
6Route 5567 FNo
7Route 921 ANo
8Route 921Yes
9Route 921 FNo
Sheet1
Cell Formulas
RangeFormula
B2:B9B2=IF(ISNUMBER(--RIGHT(A2)),"Yes","No")
 
Upvote 0

Forum statistics

Threads
1,215,148
Messages
6,123,306
Members
449,095
Latest member
Chestertim

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