How can I find the maximum string value associated with a number in another cell in Excel or Google Sheets?

I have a spreadsheet where one column contains letters representing categories (like F1, F2, F3 for category ‘F’ and G1, G2, G3 for category ‘G’). My goal is to identify the highest entry per category—such as ‘F3’—and display this information in separate cells for each category. I’m struggling to properly combine the strings and numbers to extract the maximum from each category. This is important because I want to maintain an up-to-date record for each category; when I add new products, I need to know the next available identifier without manually searching through the entire list. For example, if the maximum for the F category is ‘F37’, I should assign ‘F38’ to the next product without device searching.

have you tried using a helper column to extract the numeric value with TEXT functions? You can then use MAXIFS to get the highest number for each category, combine it back with the category letter. It’s working fine for me. Cheers!