CHOOSECOLS, BYROW, LET, SPILL ARRAY, Return Blank Value

ScottTemple

Board Regular
Joined
Dec 28, 2023
Messages
103
Office Version
  1. 365
Platform
  1. Windows
Hello,

I have the following formula:

=CHOOSECOLS(A2#,13)-BYROW(CHOOSECOLS(A2#,23,24,28,29),LAMBDA(br,SUM(br)))
However, if the value in A2#,13 is missing, I receive a #VALUE! error. I've made attempts to correct this, but the best formula I could come up with does not work (see below). Any thoughts?

=LET(a,CHOOSECOLS(A2#,13)-BYROW(CHOOSECOLS(A2#,23,24,28,29),LAMBDA(br,SUM(br))),IF(a="","",a))
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
try this:

Excel Formula:
=LET(
a,CHOOSECOLS(A2#,13),
b,IF(a="","",a),
c,CHOOSECOLS(A2#,23,24,28,29),
d,BYROW(c,LAMBDA(c,SUM(c))),
a-d)
 
Upvote 1
if the value in A2#,13 is missing,
In that circumstance, do you want to treat the missing value as zero? If not, what calculation should occur?
Assuming the zero option, see if this works for you.

Excel Formula:
=N(CHOOSECOLS(A2#,13))-BYROW(CHOOSECOLS(A2#,23,24,28,29),LAMBDA(br,SUM(br)))
 
Upvote 1
Solution
You're welcome. Thanks for the follow-up. :)
 
Upvote 0

Forum statistics

Threads
1,215,721
Messages
6,126,461
Members
449,315
Latest member
misterzim

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