Formulas and Functions Help
- Welcome
- Intro to formulas and functions
-
- ACCRINT
- ACCRINTM
- BONDDURATION
- BONDMDURATION
- COUPDAYBS
- COUPDAYS
- COUPDAYSNC
- COUPNUM
- CUMIPMT
- CUMPRINC
- CURRENCY
- CURRENCYCODE
- CURRENCYCONVERT
- CURRENCYH
- DB
- DDB
- DISC
- EFFECT
- FV
- INTRATE
- IPMT
- IRR
- ISPMT
- MIRR
- NOMINAL
- NPER
- NPV
- PMT
- PPMT
- PRICE
- PRICEDISC
- PRICEMAT
- PV
- RATE
- RECEIVED
- SLN
- STOCK
- STOCKH
- SYD
- VDB
- XIRR
- XNPV
- YIELD
- YIELDDISC
- YIELDMAT
-
- AVEDEV
- AVERAGE
- AVERAGEA
- AVERAGEIF
- AVERAGEIFS
- BETADIST
- BETAINV
- BINOMDIST
- CHIDIST
- CHIINV
- CHITEST
- CONFIDENCE
- CORREL
- COUNT
- COUNTA
- COUNTBLANK
- COUNTIF
- COUNTIFS
- COVAR
- CRITBINOM
- DEVSQ
- EXPONDIST
- FDIST
- FINV
- FORECAST
- FREQUENCY
- GAMMADIST
- GAMMAINV
- GAMMALN
- GEOMEAN
- HARMEAN
- INTERCEPT
- LARGE
- LINEST
- LOGINV
- LOGNORMDIST
- MAX
- MAXA
- MAXIFS
- MEDIAN
- MIN
- MINA
- MINIFS
- MODE
- NEGBINOMDIST
- NORMDIST
- NORMINV
- NORMSDIST
- NORMSINV
- PERCENTILE
- PERCENTRANK
- PERMUT
- POISSON
- PROB
- QUARTILE
- RANK
- SLOPE
- SMALL
- STANDARDIZE
- STDEV
- STDEVA
- STDEVP
- STDEVPA
- TDIST
- TINV
- TTEST
- VAR
- VARA
- VARP
- VARPA
- WEIBULL
- ZTEST
XLOOKUP
The XLOOKUP function searches a range for a specified value and returns the value from the same row in another column.
XLOOKUP(search-value, search-range, return-range, if-not-found, match-type, search-type)
search-value: The value being searched for in search-range. search-value can contain any value or a REGEX string.
search-range: The cells to search.
return-range: The cells to return.
if-not-found: An optional argument to specify the display message if a match is not found.
match-type: An optional argument that specifies the type of match to search for.
exact or next smallest (-1): If there’s no match, returns an error.
exact match (0 or omitted): If there’s no exact match, returns an error.
exact or next largest (1): If there’s no match, returns an error.
wildcard (2): *, ? and ~ have a particular meaning. REGEX can only be used in XLOOKUP if you use wildcard.
search-type: An optional argument that specifies the order in which to search the range.
Binary descending (-2): Binary search that requires range to be sorted in descending order, otherwise it returns an error.
Last to first (-1): Search the range from last to first.
First to last (1 or omitted): Search the range from first to last.
Binary ascending (2): Binary search that requires range to be sorted in ascending order, otherwise it returns an error.
Notes
If either search-range or return-range is a spanning reference (such as “B”), headers and footers are automatically ignored.
To return results from an array, use INDEX with XLOOKUP.
Examples |
---|
Given the following table: |
A | B | C | |
---|---|---|---|
1 | Name | Age | Salary |
2 | Amy | 35 | 71000 |
3 | Matthew | 27 | 81000 |
4 | Chloe | 42 | 86000 |
5 | Sophia | 51 | 66000 |
6 | Kenneth | 28 | 52000 |
7 | Tom | 49 | 62000 |
8 | Aaron | 63 | 89000 |
9 | Mary | 22 | 34000 |
10 | Alice | 29 | 52000 |
11 | Brian | 35 | 52500 |
=XLOOKUP(49,B2:B11,C2:C11) returns “62000”, which is the salary of the first employee whose age is 49. =XLOOKUP(60000,C2:C11,B2:B11,“No match”) returns “No match”, as there is no employee whose salary is £60,000. =XLOOKUP(REGEX("^C.*"), A2:A11, B2:B11, FALSE, 2) returns “42”, the age of "Chloe”, the first employee in the range whose name starts with “C”. =INDEX(XLOOKUP(A2,A2:A11,B2:C11),2) returns 71000, the second value in the array returned by XLOOKUP. |