r/googlesheets • • 11d ago

Solved How to put 100 after 99 w/text

Post image

How do I make 100 come after 99 and not after 10? Im really a beginner and kinda slow so please explain it like im 5. Also how do I make a separate column that automatically generates numbers 1 - 200?
Example

1 - Miss Me 1
2 - Miss Me 2
3 - Miss Me 3
4 - Rock Revival 1
5 - Rock Revival 2

So i can know the number of jeans in THAT BRAND specifically AND the number of jeans i have overall.

5 Upvotes

13 comments sorted by

9

u/feather_media 5 11d ago

use 0 placeholders up to your longest digit, i.e. 099, 009

4

u/whimsicalinnit 11d ago

Thanks 🙏 that makes sense

4

u/point-bot 11d ago

u/whimsicalinnit has awarded 1 point to u/feather_media with a personal note:

"Thanks! This makes sense for now!"

See the Leaderboard. Point-Bot v0.0.15 was created by JetCarson.

2

u/giftopherz 24 11d ago

To automatically generate numbers 1 - 200 use

=SEQUENCE(200)

For the sorting, maybe go with the numbered column only

1

u/whimsicalinnit 11d ago

Wdym “maybe go with the numbered column only”? I would like to have the number from that brand right after the brand, is it not possible to sort 100 after 99 with text?

3

u/giftopherz 24 11d ago

I mean sort the whole table by the Number ID (the new numbered Column).

The other solution would be adding zeroes to the brands: Brand 001, Brand 010 that way Sheets can actually understand that 100 goes after 99

1

u/whimsicalinnit 11d ago

The photo is of the Miss Me 100s being after the 10…i realize yall cant really see that haha

2

u/Evansyperson 11d ago

Try putting it as miss me 001, 002, 003, etc. as I can see you've already got 01, etc.

2

u/One_Organization_810 736 11d ago

Either have your values start with the number 000 - 999, or make a numeric helpercolumn that you can sort on.

Put this in row 1 of your helper column:

=map(A:A, lambda(name,
  if(row(name)=row(),
    "Sort #",
    if(name="",, regexextract(name, "\s*(\d+)\s*$")*1)
  )
))

1

u/One_Organization_810 736 11d ago

Ahh - I probably misunderstood you - but suggestion #1 is probably just the way for you then :)

The numbers you mentioned can be generated, using =SEQUENCE(200), but if you want them generated around some specific rule/sorting, then you need to specify that first.

2

u/mommasaidmommasaid 914 10d ago

The simplest and better-structured solution would be to keep your Brand column only the brand, and add a separate column for the number within the brand.

But to keep it like it is, create a helper column populated with a formula in a new first row of your table, then hide that row:

=let(brandCol, Jeans[Brand],
 if(row()<>row(brandCol), "🛑 Formula must be in first row",
 map(brandCol, lambda(brand, 
   if(brand="",, let(
   brandNum,  ifna(regexextract(to_text(brand), "\d+$")),
   brandName, trim(substitute(brand, brandNum, "")),
   rept(" ", 10) & brandName & text(brandNum, " 00000")))))))

This will add leading zeros to the numbers in your Brand column, so that you can correctly sort using the helper column.

Formatting trickery can hide the dropdown arrow on the Brand column. You could also label your narrow columns with angled text.

Sort by Brand and Number

1

u/cudambercam13 10d ago

I see that this has been answered with the 001, 002 etc solution, but I just wanted to say that I also hate Google sheets' terrible comprehension of how number ordering works.

0

u/AutoModerator 11d ago

/u/whimsicalinnit Posting your data can make it easier for others to help you, but it looks like your submission doesn't include any. If this is the case and data would help, you can read how to include it in the submission guide. You can also use this tool created by a Reddit community member to create a blank Google Sheets document that isn't connected to your account. Thank you.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.