How do I increment a string value in Google Spreadsheet? - google-sheets

Long time Lurker reporting in! My issue is I'm not sure how to increment an Item no. It follows this format : LK0001 the row below it will be LK0002, below that LK0003 and so on I'm not sure how to automate this process, as you can tell I'm fairly new to google spreadsheets Sorry if it's already answered , I just can't seem to find it! Thanks!
Weej

First of all, I would suggest using the following ID build-up:
LK1000
This way characters (LK) can be separated from integers (1000). Otherwise you would face the problem, that if you increase LK0009 by 1 it becomes LK00010 and not LK0010
ID's need to be "hard coded", meaning =CONCAT or =A1+1 or =MAX(A:A)+1 are not allowed.
Either go by typing LK+max. number and use the ID as a text or go for the integers and use CONCAT when needed.
If you chose to go with the integers, you can easily increment them by doing this:
and then dragging it downwards, yielding:
I've prepared an example for you: How do I increment a string value in Google Spreadsheet?

Related

Replace user created blanks with 0's

I made a binary calculator with bitwise functions (bitand, bitor, bitxor, ect.) in google sheets (yes I am aware that there are built in functions to do this, this seemed more fun). It is an 8 bit calculator, and I currently have addition and subtraction implemented. Multiplication is planned, but seems way too hard at the moment
One of the things I came across is once a calculation is done, the user has to manually 0 out the addends/minuend and subtrahend one digit at a time. I would like to optimize this process.
I can easily create a script that will input 0 into all the cells and hook that up to a button. I have a feeling that's the route I'm going to have to go. But I want to challenge myself in making cool stuff, so I want the coolest solution.
My question is: is there a way I can do this without a script attached? I've been experimenting with ARRAYFORMULA and VLOOKUP, but I don't have a clear answer yet.
Expected behavior:
User inputs their calculation. User records the answer. User selects both 8 bit binary numbers (currently residing in A1:H2) and presses backspace. Google Sheet automatically translates those blank cells to 0's.
take a look into custom internal formatting. any text can be converted to "0"
then see shifted arrays:
={"", "x"}
formula from G9 will print "0" into H9. also, you can anytime enter value in H9 to "overwrite" the zero and after you don't need the entered value you just clear it with backspace or delete key and it will be filled with "0" again.
also, note that after you enter value in H9, G9 will error out and such error cant be suppressed so see hidden cells:
not sure if it's cool enough but it works (with compromises)

How do i stop google sheet from auto-calculation?

I have a sheet that will record delivery information. However one of the record we have right now have a barcode that start with equal (=) symbol(=00000-00). So whenever we fired our barcode reader at it. it return as 5 digits number (10000) with minus calculation instead of our office-use 7 digits number format. (10077-77)
From what i know, In excel you can turn auto-calculation off as simple as turning format into text for use manual setting for calculation. However that doesn't seems to be the case here for Google Sheet. Is there any workaround for this? I tried =right(B2, len(B2)-1) but all it does is removing first number out and ignore equal symbol entirely.
I believe the best workaround is to treat it like a string:
You also have the option of displaying formulas:
Yet if you use a value of =0000-00 or something with starting zeros, it will not display the zeros:

Number/Word Splicer for Google Spreadsheets

I am trying to make a google spreadsheet that splits a word or string of numbers in half and puts the back half in front of the first half in a new column. However, I am new to this who process and so I came here to ask for help. I originally tried macros but couldn't get them to copy and paste information from columns.
Here is the basic idea:
The spreadsheet cuts the number or word in half putting the back in front.
Thanks for everyone's time.
In case of an odd number of chars, ROUNDUP must be used in RIGHT or LEFT function:
=ArrayFormula(RIGHT(A1:A,ROUNDUP(LEN(A1:A)/2)) & left(A1:A,LEN(A1:A)/2))
I think your problem shall be solved using the following code:
=CONCATENATE(right(A2,len(A2)/2),LEFT(A2,len(A2)/2))

Making custom slots using Regex in amazon Lex

I want to make custom slots that accepts any and all entries as long as those entries follow a certain regex pattern, eg:any number of alphabets or numbers but without a space in between. Can anyone tell me if there is a way in amazon lex to achieve it?
Also, if I want to take a certain type of data, say, email ids, but want to give the user option to give any number of email ids (more than one), what is the way to do that.
I am new to Amazon Lex and any suggestions would be appreciated.
Make a slot in Lex console in your intent but do not tick as required, and give any type as slot type.
Now in lambda code, first set the slot to null and then parse the inputText using regex and assign the correct value to the slot.
This way both of your problems will be addressed.
Hope it helps. Let us know if you run in any problems.

Google spreadsheets - how to handle duration: store and use in calculations?

I've got a lot of "duration" values - basically a race duration - in a format m:ss.millis [4:03.810 for example].
Currently GS handles it as text, but I would like to use those values for comparison and create some statistics.
Is this possible? I have read this: How to format a duration as HH:mm in the new Google sheets but even though I have created a custom formats like:
or
but neither with one nor with another I cannot use those values for calculations. GS always complains about the values beeing stored as text.
I guess I'm just doing something wrong, but I definitely need to be able to provide values in this format and be able to use them in calculations.
How can I do that?
I regret that Duration seems to be a useless abomination and Sheets appears to offer no relatively easy way to convert text representation to values. Pending a better answer I suggest you convert all your durations as below:
=(left(A1,find(":",A1)-1)+right(A1,6)/60)/1440
format as Number:
mm:ss.000
and then apply your formulae.
(Change , to ; if required by your locale.)
A shorter formula might be used to cajole TIMEVALUE to work by including an hour value of 0:
=TIMEVALUE("00:"&A1)
A happy coincidence brought me back here because only very recently have I found that Google Sheets does offer a way to convert Text to Number (or I was having another aberration when I claimed otherwise). However, this still seems not to apply to Duration. Maybe there is yet hope though.

Resources