Is there a way to generate TeamViewer Passwords in Excel? - excel

I am attempting to make Excel generate a 6-character password string, exactly like TeamViewer (3 letters, 3 numbers). Is there a function I might be unaware of?
I have tried =CHOOSE(RANDBETWEEN(1,2),CHAR(RANDBETWEEN(0,9)),CHAR(RANDBETWEEN(97,122)))&CHOOSE(RANDBETWEEN(1,2),CHAR(RANDBETWEEN(0,9)),CHAR(RANDBETWEEN(97,122)))&CHOOSE(RANDBETWEEN(1,2),CHAR(RANDBETWEEN(0,9)),CHAR(RANDBETWEEN(97,122)))&CHOOSE(RANDBETWEEN(1,2),CHAR(RANDBETWEEN(0,9)),CHAR(RANDBETWEEN(97,122)))&CHOOSE(RANDBETWEEN(1,2),CHAR(RANDBETWEEN(0,9)),CHAR(RANDBETWEEN(97,122)))&CHOOSE(RANDBETWEEN(1,2),CHAR(RANDBETWEEN(0,9)),CHAR(RANDBETWEEN(97,122))), and here's an example of one of the results: ckjfs.
Please see above for the Formula.
The expected result is something like: aaa111, or 1aaa11. I don't want the Formula to allow something like 11aaaa, aaaaaa, or 1234aa.

Here is an option for you to consider:
Formula in A2:
=RANDBETWEEN(1,6)
Formula in B2:
=CHAR(RANDBETWEEN(IF(OR(RANK.EQ(A2,$A$2:$A$7)+COUNTIF($A$2:A2,A2)-1={1,2,3}),48,97),IF(OR(RANK.EQ(A2,$A$2:$A$7)+COUNTIF($A$2:A2,A2)-1={1,2,3}),57,122)))
Drag down.....
Formula in D2:
Excel 2016 with CONCAT:
=CONCAT(C2:C7)
Lower versions without CONCAT:
=C2&C3&C4&C5&C6&C7

I can offer this rather long array formula:
=ArrayFormula(TEXTJOIN("",TRUE,IF(MID(TEXT(DEC2BIN(INDEX({7,11,13,14,19,21,22,25,26,28,35,37,38,41,42,44,49,50,52,56},RANDBETWEEN(1,20))),"000000"),{1,2,3,4,5,6},1)="0",
CHAR(CHOOSE({1,2,3,4,5,6},RANDBETWEEN(48,57),RANDBETWEEN(48,57),RANDBETWEEN(48,57),RANDBETWEEN(48,57),RANDBETWEEN(48,57),RANDBETWEEN(48,57))),
CHAR(CHOOSE({1,2,3,4,5,6},RANDBETWEEN(97,122),RANDBETWEEN(97,122),RANDBETWEEN(97,122),RANDBETWEEN(97,122),RANDBETWEEN(97,122),RANDBETWEEN(97,122))))))
I had to test it in Google Sheets because I only have an old version of Excel without the array concatenation features - it should work in later versions of Excel if you remove the ArrayFormula wrapper and enter it with Ctrl-Shift-Enter.
The idea is that there are only 20 ways of selecting 3 items (letters) out of 6 (letters and numbers) so choose one of them in binary (e.g. 010101) and generate letters where there are 1's and numbers where there are 0's.
EDIT
Confirmed working through Excel 2019, confirmed through CtrlShiftEnter:

Related

How to use MID, RIGHT and FIND functions in Excel?

I am trying to combine the State (NSW) and the Postal Code (2007) from cell F4 in the worksheet "Inventory", this is the text in cell F4: 310 Wattle StUltimo, 2007, NSW
What I trying to accomplish is this: NSW2007 using MID, RIGHT and FIND functions, but is giving me a headache
I tried this: =RIGHT(Inventory!F4,4) and I got so far this: NSW, what I need to get is NSW2007 so I am missing the MID (and FIND) part
thanks for your help in advance
With Office 365:
=LET(
rr,F4,
x,TRIM(TEXTSPLIT(rr,",")),
CONCAT(INDEX(x,COUNTA(x)-{0,1})))
For Older versions:
=TRIM(RIGHT(SUBSTITUTE(F4,",",REPT(" ",999)),999))&
TRIM(MID(SUBSTITUTE(F4,",",REPT(" ",999)),(LEN(F4)-LEN(SUBSTITUTE(F4,",",""))-1)*999,999))
If there is always only 2 , in the string and you want the 3rd and 2nd then we can simplify the above formula:
=LET(
rr,F4,
x,TRIM(TEXTSPLIT(rr,",")),
CONCAT(INDEX(x,{3,2})))
And
=TRIM(RIGHT(SUBSTITUTE(F4,",",REPT(" ",999)),999))&
TRIM(MID(SUBSTITUTE(F4,",",REPT(" ",999)),999,999))
I used the following Excel text formula.
Using the text in F4: "310 Wattle StUltimo, 2007, NSW"
To get NSW2007 from the text in F4 above use the following formula.
=CONCAT(TRIM(MID(F4,FIND(",",F4,FIND(",",F4,1)+1)+1,LEN(F4))),TRIM(MID(F4,FIND(",",F4,1)+1,FIND(",",F4,FIND(",",F4,1)+1)-FIND(",",F4,1)-1)))
To get NSW: =MID(F4,FIND(",",F4,FIND(",",F4,1)+1)+1,LEN(F4))
To get 2007: =MID(F4,FIND(",",F4,1)+1,FIND(",",F4,FIND(",",F4,1)+1)-FIND(",",F4,1)-1)
Then concatenate the two: concat (formula 1 above, formula 2 above).
This formula works regardless of the spaces (or no spaces at all) before and after the commas.
Hope this helps.

Excel formula to SUM all numbers in a cell with text

I have cells in my spreadsheet who are like:
RF(4);MN(4);LL(2);TE(4);HA(2)
There is a formula where I can sum all the numbers in that String/Cell?
I can try another way by Office Script, but since he has low speed, and I have to sum a lot of lines of cells with those type of string, i would try to accelerate the process with Excel Formula as much as possible.
best regards
With Excel 2013 and later you can use FILTERXML to pull out the numbers and wrap that in SUMPRODUCT to return the sum:
=SUMPRODUCT(FILTERXML("<t><s>"&SUBSTITUTE(SUBSTITUTE(A1,")","</s><s>"),"(","</s><s>")&"</s></t>","//s[number()=.]"))
One note, this does not work in Excel online or the phone/tablet apps. And some versions of mac also do not have FILTERXML.
If they are always single digit we can use:
=SUMPRODUCT(IFERROR(--MID(A1,SEQUENCE(LEN(A1)),1),0))
or older version:
=SUMPRODUCT(IFERROR(--MID(A1,ROW($ZZ$1:INDEX($ZZ:$ZZ,LEN(A1))),1),0))
For some versions this will require the use of Ctrl-Shift-Enter instead of Enter when exiting edit mode to make it an array formula.
What you want to do is delimit the column based on ";"
Data --> Text to Columns --> Delimit / Next --> Semicolon --> Finish
This will separate the column into 5 columns based on the data you gave, now you'll add 5 additional helper columns that will extract the number.
Assuming your new Data goes from A2:E2 and downward, placing this formula in F2:J2 =SUMPRODUCT(MID(0&A2, LARGE(INDEX(ISNUMBER(--MID(A2, ROW(INDIRECT("1:"&LEN(A2))), 1)) * ROW(INDIRECT("1:"&LEN(A2))), 0), ROW(INDIRECT("1:"&LEN(A2))))+1, 1) * 10^ROW(INDIRECT("1:"&LEN(A2)))/10)
After dragging this formula across the 5 columns (separating the numbers from text); Add 1 last column summing these 5 new columns.
This should be able to handle multiple digits in a single group of parenthesis. You can avoid having all the additional columns, by adding the formula for each column together. I just break this out so if there's issues you have visibility in what's happening and how it works.

How can I add a comma & space after every two digits in Excel and then format the text?

Here's the table I'm working with:
First off, how can I separate the string of numbers in column C so that they have a comma and space after every two digits?
I was able to partially finish it, but for some reason I can't grab the last two digits. I used this formula:
=MID(C4,1,2)&", "&MID(C4,3,2)&", "&MID(C4,6,2)&", "&MID(C4,10,2)&", "&MID(C4,13,2)&", "&MID(C4,16,2)
After that I need to somehow format that string to look like the example in column E, that's where I'm really confused. Maybe I don't even need the first step?
Any help is appreciated. Thanks
If you already have access to TEXTJOIN formula then it will quickly become your best friend :-)
I assume that your values are in column C (starting from cell C1) and that the column is formatted as text.
Try:
="""stats"":["&TEXTJOIN(", ",TRUE,MID(C1,ROW($A$1:INDEX(A:A,LEN(C1)/2))*2-1,2))&"]"
If your Office 365 version is not using dynamic arrays yet, try entering the formula with Ctrl+Shift+Enter:

Sum Filtered Values Excel

I am finding the sum of filtered values while ignoring #DIV/0! errors. As such, I combined the following formulas:
=SUBTOTAL(9,$I$2:$I$349)
and
=SUMIF($I$2:$I$349,"<>#DIV/0!")
To get:
SUBTOTAL(9,SUMIF($I$2:$I$349,"<>#DIV/0!"))
However, excel returns an error. Any insights?
Is it that I cannot place a formula within another formula?
Which version of Excel are you using?
In Excel 2010 and later versions AGGREGATE function works a little bit like SUBTOTAL - it can perform various functions while ignoring hidden rows.......but it also has options to ignore error values, so without any helper columns you can use this single formula
=AGGREGATE(9,7,I2:I349)
9 denotes "sum" as per SUBTOTAL while 7 as the 2nd argument indicates that error values and hidden values should be ignored. There are other options, see Excel Help for more
I found this bit of brilliance with some digging on the webs: http://www.excelbanter.com/showthread.php?p=760730
It's a difficult formula to follow, but should do the trick.
{=SUM(IF(ISNUMBER($I$2:$I$349),$I$2:$I$349)*(SUBTOTAL(3,OFFSET($I$2:$I$349,ROW($I$2:$I$349)-MIN(ROW($I$2:$I$349)),0,1))))}
It's an array formula, so make sure to press Ctrl + Shift + Enter (instead of just Enter).
I can't pretend to understand it all without really digging into it, but it works!
Use a helper column
In H2 enter:
=IFERROR(G2,"")
and copy down and then use:
=SUBTOTAL(9,$H$2:$H$349)
=IFERROR(SUBTOTAL(9,$I$2:$I$349),"")

Using SUMIFS with multiple AND OR conditions

I would like to create a succinct Excel formula that SUMS a column based on a set of AND conditions, plus a set of OR conditions.
My Excel table contains the following data and I used defined names for the columns.
Quote_Value (Worksheet!$A:$A) holds an accounting value.
Days_To_Close (Worksheet!$B:$B) contains a formula that results in a number.
Salesman (Worksheet!$C:$C) contains text and is a name.
Quote_Month (Worksheet!$D:$D) contains a formula (=TEXT(Worksheet!$E:$E,"mmm-yy"))to convert a date/time number from another column into a text based month reference.
I want to SUM Quote_Value if Salesman equals JBloggs and Days_To_Close is equal to or less than 90 and Quote_Month is equal to one of the following (Oct-13, Nov-13, or Dec-13).
At the moment, I've got this to work but it includes a lot of repetition, which I don't think I need.
=SUM(SUMIFS(Quote_Value,Salesman,"=JBloggs",Days_To_Close,"<=90",Quote_Month,"=Oct-13")+SUMIFS(Quote_Value,Salesman,"=JBloggs",Days_To_Close,"<=90",Quote_Month,"=Nov-13")+SUMIFS(Quote_Value,Salesman,"=JBloggs",Days_To_Close,"<=90",Quote_Month,"=Dec-13"))
What I'd like to do is something more like the following but I can't work out the correct syntax:
=SUMIFS(Quote_Value,Salesman,"=JBloggs",Days_To_Close,"<=90",Quote_Month,OR(Quote_Month="Oct-13",Quote_Month="Nov-13",Quote_Month="Dec-13"))
That formula doesn't error, it just returns a 0 value. Yet if I manually examine the data, that's not correct. I even tried using TRIM(Quote_Month) to make sure that spaces hadn't crept into the data but the fact that my extended SUM formula works indicates that the data is OK and that it's a syntax issue. Can anybody steer me in the right direction?
You can use SUMIFS like this
=SUM(SUMIFS(Quote_Value,Salesman,"JBloggs",Days_To_Close,"<=90",Quote_Month,{"Oct-13","Nov-13","Dec-13"}))
The SUMIFS function will return an "array" of 3 values (one total each for "Oct-13", "Nov-13" and "Dec-13"), so you need SUM to sum that array and give you the final result.
Be careful with this syntax, you can only have at most two criteria within the formula with "OR" conditions...and if there are two then in one you must separate the criteria with commas, in the other with semi-colons.
If you need more you might use SUMPRODUCT with MATCH, e.g. in your case
=SUMPRODUCT(Quote_Value,(Salesman="JBloggs")*(Days_To_Close<=90)*ISNUMBER(MATCH(Quote_Month,{"Oct-13","Nov-13","Dec-13"},0)))
In that version you can add any number of "OR" criteria using ISNUMBER/MATCH
You can use DSUM, which will be more flexible. Like if you want to change the name of Salesman or the Quote Month, you need not change the formula, but only some criteria cells. Please see the link below for details...Even the criteria can be formula to copied from other sheets
http://office.microsoft.com/en-us/excel-help/dsum-function-HP010342460.aspx?CTT=1
You might consider referencing the actual date/time in the source column for Quote_Month, then you could transform your OR into a couple of ANDs, something like (assuing the date's in something I've chosen to call Quote_Date)
=SUMIFS(Quote_Value,"<=90",Quote_Date,">="&DATE(2013,11,1),Quote_Date,"<="&DATE(2013,12,31),Salesman,"=JBloggs",Days_To_Close)
(I moved the interesting conditions to the front).
This approach works here because that "OR" condition is actually specifying a date range - it might not work in other cases.
Quote_Month (Worksheet!$D:$D) contains a formula (=TEXT(Worksheet!$E:$E,"mmm-yy"))to convert a date/time number from another column into a text based month reference.
You can use OR by adding + in Sumproduct. See this
=SUMPRODUCT((Quote_Value)*(Salesman="JBloggs")*(Days_To_Close<=90)*((Quote_Month="Cond1")+(Quote_Month="Cond2")+(Quote_Month="Cond3")))
ScreenShot
Speed
SUMPRODUCT is faster than SUM arrays, i.e. having {} arrays in the SUM function. SUMIFS is 30% faster than SUMPRODUCT.
{SUM(SUMIFS({}))} vs SUMPRODUCT(SUMIFS({})) both works fine, but SUMPRODUCT feels a bit easier to write without the CTRL-SHIFT-ENTER to create the {}.
Preference
I personally prefer writing SUMPRODUCT(--(ISNUMBER(MATCH(...)))) over SUMPRODUCT(SUMIFS({})) for multiple criteria.
However, if you have a drop-down menu where you want to select specific characteristics or all, SUMPRODUCT(SUMIFS()), is the only way to go. (as for selecting "all", the value should enter in "<>" + "Whatever word you want as long as it's not part of the specific characteristics".
In order to get the formula to work place the cursor inside the formula and press ctr+shift+enter and then it will work!
With the following, it is easy to link the Cell address...
=SUM(SUMIFS(FAGLL03!$I$4:$I$1048576,FAGLL03!$A$4:$A$1048576,">="&INDIRECT("A"&ROW()),FAGLL03!$A$4:$A$1048576,"<="&INDIRECT("B"&ROW()),FAGLL03!$Q$4:$Q$1048576,E$2))
Can use address / substitute / Column functions as required to use Cell addresses in full DYNAMIC.

Resources