Performance issue

kweaver

Well-known Member
Joined
May 12, 2009
Messages
2,940
Office Version
  1. 365
I have a sheet that concatenates text with the result of a formula...and this process happens several times within a given cell.
For example, I have to find a person's ID in a column and then extract an assortment of data from other cells accordingly.

Two choices work: (1) using XLOOKUP repeatedly such as
="blah blah blah" & XLOOKUP(B1,People!B3:B5000,People!C3:C5000) & "more blah, blah" & XLOOKUP(B1,People!B3:B5000,People!H3:H5000) & "more blah blah"

or (2) using XLOOKUP once, place the result in a cell and then use INDEX repeatedly such as: =INDEX(People!C3,C5000,A1)
Where A1 contains the row from ONE XLOOKUP.

Is there any performance issue that would favor one approach over another?
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
I don't have any reason to believe that there is a significant performance difference between XLookup and Index.
Since XLookup is an option for you, you most likely can use the LET command. This can reduce the need to do repeated whole of range Lookups so you only need to lookup each row once.

Book1
ABCDEFG
1Data
2
3FruitColourStatusStateInputReturn Value
4PEARGREENSOFTNSWPearPEAR more text SOFT Even more text GREEN
5APPLEREADSOFTVIC
Sheet1
Cell Formulas
RangeFormula
G4G4=LET(iRow, XLOOKUP(F4,$A$4:$A$5,$A$4:$D$5),INDEX(iRow,0,1) & " more text " & INDEX(iRow,0,3) & " Even more text " & INDEX(iRow,0,2))
 
Upvote 0

Forum statistics

Threads
1,223,952
Messages
6,175,596
Members
452,657
Latest member
giadungthienduyen

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