Get.Cell in LAMBDA Issue

Jeffrey Mahoney

Well-known Member
Joined
May 31, 2015
Messages
2,797
Office Version
  1. 365
Platform
  1. Windows
I'm using =LAMBDA(Cel,SUM(GET.CELL(16,Cel))) to return the column width with decimals because =Cell("width",A1) only returns the integer value of the cell width. The named range is called CellWidth

Then I wanted to get the total column widths from a range of cells using this:
=LAMBDA(Rng,[X],[Cnt],[Wid],IF(X=0,ColsWidth(Rng,1,COLUMNS(Rng),0),IF(X<Cnt,ColsWidth(Rng,X+1,Cnt,Wid+CellWidth(INDEX(Rng,1,X))),Wid+CellWidth(INDEX(Rng,1,X)))))
It works fine and I call that named range ColsWidth

Then I thought that I could just put the CellWidth formula right into the ColsWidth Lambda formula and write it like this:
=LAMBDA(Rng,[X],[Cnt],[Wid],IF(X=0,ColsWidth(Rng,1,COLUMNS(Rng),0),IF(X<Cnt,ColsWidth(Rng,X+1,Cnt,Wid+Get.Cell(16,INDEX(Rng,1,X))),Wid+Get.Cell(16,INDEX(Rng,1,X)))))

It gives me an error. Am I to assume that the Get.Cell function doesn't know how to work with variables in the Lambda function?

I wanted to post my Lambda function on this site as a stand alone function, but it may turn out that I'll have to provide instructions for the simple CellWidth Lambda also.
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.

Forum statistics

Threads
1,215,076
Messages
6,122,984
Members
449,092
Latest member
Mr Hughes

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