ByRow & Lambda with let function issue

nmmounir

New Member
Joined
Jul 26, 2023
Messages
17
Office Version
  1. 365
Platform
  1. Windows
I have a list of items (Brine types) in column A. I am interesting in extracting the NaCl brine (A2:A18) only (Exclude all KCl brines that are in A19 to A32) then sort them in an ascending order.
I used the Let function to extract the NaCl brine in column C. Then I wanted to sort them as previously mentioned. to do this, I have to extract the numbers form the NaCl brines which I did in column E then I sort them sorted them using the Large function in column F then I used sortby function to finally sort the NaCl brine list in Column H
As you can see, I had to use several steps here to accomplish this but I couldn't use all these steps inside of the let function. the Variable name of the Brine list in the let function is Filetring_Brines (column C). when trying to use this variable with the byrow & Lambda to extract the numbers as in column D, i get an N/A.... Any idea how to solve this puzzle? I tried to use the Varibale filtering_Brines # (with Hashtag) inside the ByRow but didn't work.

1696319415532.png


the formula of column C is
=LET(Brine_Name,BYROW($A$2:$A$32,LAMBDA(x,LEFT(x,MATCH(TRUE,ISNUMBER(--MID(x,ROW(INDIRECT("1:"&LEN(x))),1)),0)-2))),Brine_Condition,LEFT($C$1,MATCH(TRUE,ISNUMBER(--MID($C$1,ROW(INDIRECT("1:"&LEN($C$1))),1)),0)-2),filtering_Brines,FILTER($A$2:$A$32,Brine_Name=Brine_Condition),filtering_Brines)

the formula in column D for extracting the numbers from the filtering brines variable resulting from the above formula is

=LET(Brine_Name,BYROW($A$2:$A$32,LAMBDA(x,LEFT(x,MATCH(TRUE,ISNUMBER(--MID(x,ROW(INDIRECT("1:"&LEN(x))),1)),0)-2))),Brine_Condition,LEFT($C$1,MATCH(TRUE,ISNUMBER(--MID($C$1,ROW(INDIRECT("1:"&LEN($C$1))),1)),0)-2),filtering_Brines,FILTER($A$2:$A$32,Brine_Name=Brine_Condition),Extract_Numbers,BYROW(filtering_Brines,LAMBDA(x,TRIM(MID(x,MATCH(TRUE,ISNUMBER(--MID(x,ROW(INDIRECT("1:"&LEN(x))),1)),0),SEARCH("ppg",x)-MATCH(TRUE,ISNUMBER(--MID(x,ROW(INDIRECT("1:"&LEN(x))),1)),0)))+0)),Extract_Numbers)

I Tried to use the XL2BB but the mini sheet options is not there.
1696319295563.png
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
To use the mini sheet u mean ? Yes I did and the mini sheet is always greyed out
You did check that Windows isn't blocking the file (right click the file, Properties, General, near the bottom check if there is an Unblock checkbox)?
 
Upvote 0
How about:
Book1
ABC
1Brine typeNaCI Brine 10.0 ppg
2NaCI Brine 8.4 ppgNaCI Brine 9.9 ppg
3NaCI Brine 8.5 ppgNaCI Brine 9.8 ppg
4NaCI Brine 8.6 ppgNaCI Brine 9.7 ppg
5NaCI Brine 8.7 ppgNaCI Brine 9.6 ppg
6NaCI Brine 8.8 ppgNaCI Brine 9.5 ppg
7NaCI Brine 8.9 ppgNaCI Brine 9.4 ppg
8NaCI Brine 9.0 ppgNaCI Brine 9.3 ppg
9NaCI Brine 9.1 ppgNaCI Brine 9.2 ppg
10NaCI Brine 9.2 ppgNaCI Brine 9.1 ppg
11NaCI Brine 9.3 ppgNaCI Brine 9.0 ppg
12NaCI Brine 9.4 ppgNaCI Brine 8.9 ppg
13NaCI Brine 9.5 ppgNaCI Brine 8.8 ppg
14NaCI Brine 9.6 ppgNaCI Brine 8.7 ppg
15NaCI Brine 9.7 ppgNaCI Brine 8.6 ppg
16NaCI Brine 9.8 ppgNaCI Brine 8.5 ppg
17NaCI Brine 9.9 ppgNaCI Brine 8.4 ppg
18NaCI Brine 10.0 ppg
19KCI Brine 8.4 ppg
20KCI Brine 8.5 ppg
21KCI Brine 8.6 ppg
22KCI Brine 8.7 ppg
23KCI Brine 8.8 ppg
24KCI Brine 8.9 ppg
25KCI Brine 9.0 ppg
26KCI Brine 9.1 ppg
27KCI Brine 9.2 ppg
28KCI Brine 9.3 ppg
29KCI Brine 9.4 ppg
30KCI Brine 9.5 ppg
31KCI Brine 9.6 ppg
32KCI Brine 9.7 ppg
33KCI Brine 9.8 ppg
34KCI Brine 9.9 ppg
35KCI Brine 10.0 ppg
Sheet1
Cell Formulas
RangeFormula
C1:C17C1=LET( rng,A2:A35, f,FILTER(rng,LEFT(rng,4)="NaCI"), n,--TEXTBEFORE(TEXTAFTER(f,"Brine ")," ppg"), SORTBY(f,n,-1) )
Dynamic array formulas.
 
Upvote 0
Solution
How about:
Book1
ABC
1Brine typeNaCI Brine 10.0 ppg
2NaCI Brine 8.4 ppgNaCI Brine 9.9 ppg
3NaCI Brine 8.5 ppgNaCI Brine 9.8 ppg
4NaCI Brine 8.6 ppgNaCI Brine 9.7 ppg
5NaCI Brine 8.7 ppgNaCI Brine 9.6 ppg
6NaCI Brine 8.8 ppgNaCI Brine 9.5 ppg
7NaCI Brine 8.9 ppgNaCI Brine 9.4 ppg
8NaCI Brine 9.0 ppgNaCI Brine 9.3 ppg
9NaCI Brine 9.1 ppgNaCI Brine 9.2 ppg
10NaCI Brine 9.2 ppgNaCI Brine 9.1 ppg
11NaCI Brine 9.3 ppgNaCI Brine 9.0 ppg
12NaCI Brine 9.4 ppgNaCI Brine 8.9 ppg
13NaCI Brine 9.5 ppgNaCI Brine 8.8 ppg
14NaCI Brine 9.6 ppgNaCI Brine 8.7 ppg
15NaCI Brine 9.7 ppgNaCI Brine 8.6 ppg
16NaCI Brine 9.8 ppgNaCI Brine 8.5 ppg
17NaCI Brine 9.9 ppgNaCI Brine 8.4 ppg
18NaCI Brine 10.0 ppg
19KCI Brine 8.4 ppg
20KCI Brine 8.5 ppg
21KCI Brine 8.6 ppg
22KCI Brine 8.7 ppg
23KCI Brine 8.8 ppg
24KCI Brine 8.9 ppg
25KCI Brine 9.0 ppg
26KCI Brine 9.1 ppg
27KCI Brine 9.2 ppg
28KCI Brine 9.3 ppg
29KCI Brine 9.4 ppg
30KCI Brine 9.5 ppg
31KCI Brine 9.6 ppg
32KCI Brine 9.7 ppg
33KCI Brine 9.8 ppg
34KCI Brine 9.9 ppg
35KCI Brine 10.0 ppg
Sheet1
Cell Formulas
RangeFormula
C1:C17C1=LET( rng,A2:A35, f,FILTER(rng,LEFT(rng,4)="NaCI"), n,--TEXTBEFORE(TEXTAFTER(f,"Brine ")," ppg"), SORTBY(f,n,-1) )
Dynamic array formulas.
it worked perfectly thank you very much
 
Upvote 0
You did check that Windows isn't blocking the file (right click the file, Properties, General, near the bottom check if there is an Unblock checkbox)?
I don't understand what you mean?
 
Upvote 0

Forum statistics

Threads
1,224,815
Messages
6,181,136
Members
453,021
Latest member
Justyna P

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