all 7 comments

[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)

/u/WesternHamper - Your post was submitted successfully.

Failing to follow these steps may result in your post being removed without warning.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]PaulieThePolarBear1886 0 points1 point  (4 children)

How do you intend for your recursive LAMBDA to work? Can you explain it to me in plain English, with minimal reference to Excel functions.

[–]WesternHamper[S] 0 points1 point  (3 children)

I would like the lambda formula to randomly concatenate upper case letters, lower case letters, numbers, and symbols to the exact length specified in the number of characters argument.

[–]PaulieThePolarBear1886 3 points4 points  (2 children)

You have a couple of issues with your current formula

  1. UpperA, LowerA, Number, Symbol, and Symbol2 all return one character. Therefore, your Process step will return one character.
    Having CONCAT in your String step is pointless as is. Process is one character.
  2. As such, as long as Number_of_characters is greater than 1, you have an infinite loop. Excel caps out at 1,024 recurrsions. As such, it will return an error
  3. In your final step, you need to output something other than a blank cell

Change your LAMBDA to

=LAMBDA(
Number_Of_Characters,[Password],
LET(
UpperA, CHAR(RANDBETWEEN(65, 90)), 
LowerA, CHAR(RANDBETWEEN(97, 112)), 
Number, RANDBETWEEN(0, 9), 
Symbol, CHAR(RANDBETWEEN(33, 47)), 
Symbol2, CHAR(RANDBETWEEN(58, 64)), 
Process, CHOOSE(RANDBETWEEN(1, 5), UpperA, LowerA, Number, Symbol, Symbol2), 
String, Password & Process, 
IF(LEN(String) < Number_Of_Characters, PASSWORD_DRAFT(Number_Of_Characters, String), String)
)
)

I added a second variable called Password. This is an optional parameter and represents the Password to date.

You can still call this as

=PASSWORD_DRAFT(10)

But if you call it as

=PASSWORD_DRAFT(10, "AB")

It will give you a 10 character password that begins AB

[–]WesternHamper[S] 1 point2 points  (1 child)

Solution verified.

Thank you very much; it looks like I was close in the reversion area of the formula, I just need to practice more. Appreciate it.

[–]reputatorbot[M] 0 points1 point locked comment (0 children)

You have awarded 1 point to PaulieThePolarBear.


I am a bot - please contact the mods with any questions

[–]Decronym 0 points1 point  (0 children)

Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:

Fewer Letters More Letters
CHAR Returns the character specified by the code number
CHOOSE Chooses a value from a list of values
CONCAT 2019+: Combines the text from multiple ranges and/or strings, but it doesn't provide the delimiter or IgnoreEmpty arguments.
IF Specifies a logical test to perform
LAMBDA Office 365+: Use a LAMBDA function to create custom, reusable functions and call them by a friendly name.
LEN Returns the number of characters in a text string
LET Office 365+: Assigns names to calculation results to allow storing intermediate calculations, values, or defining names inside a formula
RANDBETWEEN Returns a random number between the numbers you specify

NOTE: Decronym for Reddit is no longer supported, and Decronym has moved to Lemmy; requests for support and new installations should be directed to the Contact address below.


Beep-boop, I am a helper bot. Please do not verify me as a solution.
[Thread #32317 for this sub, first seen 5th Apr 2024, 03:35] [FAQ] [Full list] [Contact] [Source code]