Sorting a list into two catagories

BradM

New Member
Joined
Jan 27, 2005
Messages
45
Hello, I having trouble with making a simple statement.

I have a list of items that belong in two catagories. The second last character in the item code defines which catagory. is it possible to have a statement that defines whether the item is in catagory a or b.


The trick is that the catagory defining character for an "A" item is either a "P" or "T" and catagory "B" is all other caracters.

ie.

123P6 = "A"
456T2 = "A"
789G1 = "B"
123H5 = "B"
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Hi

This assumes that the data is always in the same format as you have provided ie the determining character is always in position 4 of the string.

=IF(OR(MID(A1,4,1)="P",MID(A1,4,1) = "T"),"A","B")

Tony
 
Upvote 0

Forum statistics

Threads
1,213,532
Messages
6,114,177
Members
448,554
Latest member
Gleisner2

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