This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*Count of occurence and SumIfs From two different Column | |
@Author: Md.Ismail Hosen | |
@Email: [email protected] | |
@Param: NameData : This is the column which has header text | |
@Param: ValueData : This is the column from which we need to SumIf | |
*/ | |
CountAndSumReport=LAMBDA(NameData,ValueData, | |
LET( | |
UniqueFirstData,UNIQUE(NameData), | |
CHOOSE({1,2,3},UniqueFirstData,COUNTIF(NameData,UniqueFirstData),SUMIF(NameData,UniqueFirstData,ValueData)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PROPERTIESCODEGENERATOR = LAMBDA(AllVariableDeclarationCode,[IsOnlyGetter],LET( | |
AllPropertyCode, MAP(AllVariableDeclarationCode,LAMBDA(CurrentVariableDeclaration,PROPERTYCODEGENERATOR(CurrentVariableDeclaration,IsOnlyGetter))), | |
Result,REDUCE("",AllPropertyCode,LAMBDA(FinalCode,CurrentPropertyCode,FinalCode & CHAR(10) & CHAR(10) & CurrentPropertyCode)), | |
Result | |
) | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PROPERTYCODEGENERATOR = LAMBDA(VariableDeclarationLine,[IsOnlyGetter],LET( | |
SplitVariableDeclarationLine, TRANSPOSE(TEXTSPLIT(VariableDeclarationLine," ")), | |
VarNameIndex, MATCH("As",SplitVariableDeclarationLine,0)-1, | |
NonObjectDataType, {"Integer";"Long";"Single";"Double";"Currency";"Date";"String";"Boolean";"Decimal";"Byte";"LongLong"}, | |
VarName, INDEX(SplitVariableDeclarationLine,VarNameIndex,1), | |
VarDataType, INDEX(SplitVariableDeclarationLine,VarNameIndex+2,1), | |
SetPrefix, IF(ISERROR(MATCH(VarDataType,NonObjectDataType,0)),"Set ",""), | |
WithoutSetGetPropertyBodyLine, VarName & " = This." & VarName, | |
PropertyAssignWithoutSet, "this." & VarName & " = "&VarName, | |
EndPropertyCode, "End Property", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Name: Add2Cells | |
*/ | |
Add2Cells = | |
LAMBDA(Cell1,Cell2,LET( | |
\\LambdaName, "Add2Cells", | |
Cell1+Cell2 | |
) | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
VALIDQUARTERFINDER = LAMBDA(QuarterData, | |
LET( | |
FindStartDate, LAMBDA(QuarterText, | |
DATE(MID(QuarterText, 2, 4), RIGHT(QuarterText, 1) * 3 - 2, 1) | |
), | |
FindQuarterText, LAMBDA(GivenDate, | |
"Y" & YEAR(GivenDate) & "Q" & ROUNDUP(MONTH(GivenDate) / 3, 0) | |
), | |
QuarterBetweenTwoDate, LAMBDA(QuarterData, Input2, | |
LET( |


This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//This will generate character sequence based on param. | |
//Example case =CHARSEQUENCE(2, 2,"AA",2) will give an output like this ={"AA","AC";"AE","AG"} | |
CHARSEQUENCE =LAMBDA(NumberOfRow, NumberOfColumn, [StartChar], [Step], | |
LET( | |
_StartCol, IF(ISOMITTED(StartChar), 1, COLUMN(INDIRECT(StartChar & 1))), | |
_StepCorrected, IF(ISOMITTED(Step), 1, Step), | |
_Array, SEQUENCE(NumberOfRow, NumberOfColumn, _StartCol, _StepCorrected), | |
_Result, MAP( | |
_Array, | |
LAMBDA(Curr, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This function will filter a 2D Array for multiple column based on FilterForValues and comparision Criteria. | |
// ComparisionOperator can be : =,<>,>,<,>=,<= where default is = | |
// LogicalOperator can be : AND,OR where default is AND. Pass this param as text. | |
// IsHeaderPresent : Default is True | |
// You can pass same column twice. | |
// ColumnNameOrIndexes will be one row or column vector | |
// It can work on a 2D array not necessarily on Table only. | |
// Author: Md.Ismail Hosen([email protected]) | |
FilterColumns=LAMBDA(TableData, ColumnNameOrIndexes, FilterForValues, [ComparisionOperator], [IsHeaderPresent], [LogicalOperator], | |
LET( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' Format all the M code of Activeworkbook. | |
' Dependency: Microsoft XML, v6.0 (C:\Windows\System32\msxml6.dll) | |
' Developer: Md.Ismail Hosen | |
' Email : [email protected] | |
' Whatsapp: +8801515649307 | |
' LinkedIn : https://www.linkedin.com/in/md-ismail-hosen-b77500135/ | |
' Facebook : https://www.facebook.com/mdismail.hosen.7 | |
' Youtube : https://www.youtube.com/channel/UCL-q7_WvISkw0Ox9FRBBzmw | |
Public Sub FormatActiveWorkbookMCode() |
OlderNewer