Hi,
Yeah, the formula’s not all there, it’s only in the image, and it actually cuts off with a comma, so you’re missing the ending. That’s probably why you’re seeing the #CALC! error pop up.
Right now, the LET function you’ve got just sets up a list of barcode numbers from A2:A15, but it doesn’t actually do anything with it. LET needs you to finish it off with a final argument, the part that tells Excel what to return.
So, to fix this, just add your defined name (in this case, "list") at the end of the formula. That way, Excel knows to spit out the list you created. That should do the trick and show you all the barcode numbers.
=LET(ranges, A2:A15,
list, MAP(ranges, LAMBDA(r,
LET(
parts, TEXTSPLIT(r,"-"),
start, VALUE(INDEX(parts, 1)),
finish, VALUE(INDEX(parts, 2)),
SEQUENCE(finish - start + 1, 1, start)
)
)),
list)
Here’s what went wrong: the formula just named the list inside the LET function and stopped there. It skipped the last step, the part that tells Excel what to spit out. When you add "list" at the end, you finish the LET function, so Excel actually returns the dynamic array from MAP, LAMBDA, and SEQUENCE. Without that final bit, Excel has no clue what you want, so you just get a #CALC! error.
Here’s how the formula works: It grabs each hyphenated barcode range from A2 to A15 and breaks them out into every single barcode number in between. First, LET sets up those barcode cells as ranges. Then, MAP goes through each one. TEXTSPLIT slices each barcode string into its starting and ending numbers, and VALUE flips those pieces from text into actual numbers. SEQUENCE jumps in next, building a full list of numbers between the start and end for each range. Finally, that “list” line in LET pulls everything together and spits out all those barcodes into the rows below, all in one go from a single cell.
You can also check this linke for more information:
Hope that this helps, and if anything’s confusing, just drop a comment.
Thank you,