Skip to content

Instantly share code, notes, and snippets.

@Omid-M22
Omid-M22 / Extract_sum_of_Criteria
Created February 13, 2022 22:29
Easily extraction of sum (or average or min or .....) of data based on special column in excel by Lambda function
Extract_sum_of_Criteria= LAMBDA([Criteria column], [numerical column],
IF(
ISODD(
SEQUENCE(
COUNTA(
UNIQUE(
[Criteria column]
)
),
2
@Omid-M22
Omid-M22 / Month_of_Hijri_Date.txt
Last active February 13, 2022 21:41
Extraction of month name in Hijri dates by Excel Lambda function
Month_of_Hijri_Date=LAMBDA([Hijri date],
SWITCH(
--MID(
[Hijri date],
FIND("/", [Hijri date]) + 1,
FIND("/", [Hijri date], FIND("/", [Hijri date]) + 1) - FIND("/", [Hijri date]) - 1
),
1,"فروردین",
2,"اردیبهشت",
3,"خرداد",
@Omid-M22
Omid-M22 / FindX.txt
Last active February 13, 2022 21:40
Find the location of [r th repeat] of text a ([find text]) in text b ([within-text]) by Excel Lambda function
FindX=LAMBDA([find text], [within-text], [r th repeat],
IF(
[r th repeat] = 1,
FIND([find text], [within-text]),
FIND([find text], [within-text]) + findx([find text], MID([within-text], FIND([find text], [within-text]) + 1, 100), [r th repeat] - 1)
)
)
@Omid-M22
Omid-M22 / ReverseText.txt
Last active February 13, 2022 21:41
Reverse Text in Microsoft Excel by Lambda
ReverseText=LAMBDA([text],
IF(LEN([text]) = 1, [text], RIGHT([text]) & reversetext(LEFT([text], LEN([text]) - 1)))
)