Pull out a number with REGEXEXTRACT
PremiumIn B2, use REGEXEXTRACT to pull the order number out of the note in A2. Use the pattern \d+.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Note | Order number | ||||
| 2 | Order 1001 shipped | |||||
| 3 | ||||||
| 4 | ||||||
| 5 | ||||||
| 6 | ||||||
| 7 | ||||||
| 8 |
Premium lesson
Unlock REGEX functions and every other lesson
This is a premium lesson. Premium lets you solve it and every other lesson, take the timed mock tests, and earn certificates you can share on LinkedIn.
Next with premium:IFCOUNTIF
Need help?
Why this works
REGEXEXTRACT gives back the first part of the text that matches the pattern. \d+ matches the digits 1001. The result is text; wrap it in VALUE to calculate with it.
Common mistake: Using \d without the +. That gives back only the first digit, 1.
The answer
- B2
=REGEXEXTRACT(1A2,2"\d+")
In plain words: Pull 2the first run of digits out of 1the note in A2.