Take the 2-minute tour ×
Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

In my spreadsheet I have a column called S+ No. How to auto increment this for each row, like:

S1,S2,S3,S4

In short how to make it dynamic.

share|improve this question
    
Have a look at this answer: stackoverflow.com/a/14286825/1536038 –  Jacob Jan Tuinstra Feb 14 '13 at 12:04
    
I will work on a little Google Apps Script to do it automatically. –  Jacob Jan Tuinstra Feb 14 '13 at 22:01
    
Good question. I'm not sure how to concatenate the letter with the number. All I know how to do is increment the number. If cell A1 = 1 then I set A2 to =A1+1. Then when I want to increment I click and drag down the bottom right side of the cell. Hopefully that helps you get toward your goal. –  user39497 May 4 '13 at 5:17

2 Answers 2

Hopefully:

="S"&Row()  

meets your requirement. This will concatenate S with the row number the formula is in. You may wish to use an offset, so for example if you wish to start with S1 but in row 8 adjust to:

="S"&row()-7
share|improve this answer
    
That's only valid if you do not remove or insert rows... –  Jacob Jan Tuinstra May 20 at 10:20
    
@Jacob I was not (and still am not) entirely sure of the requirement - yes, it might be autoincrement as for an index in a db but you had a year for a GAS approach, and I think this is OK for removal of rows, provided it is acceptable that rows below the deleted one/s are to be adjusted automatically. –  pnuts May 20 at 11:05
    
Hold your horses pnuts, I did provide a solution on Stack Overflow (see first comment). Should I've posted the same answer here? –  Jacob Jan Tuinstra May 20 at 11:09
    
@Jacob I guess somebody should, if to the same Q and both are on topic where they are, or there would be some of the disadvantages of a link only A and A in comment. –  pnuts May 20 at 11:39

Follow this link, you will get the exact answer:

https://support.google.com/docs/answer/58173?hl=en

share|improve this answer
    
Please include the actual solution in your answer, not by just linking to another page. If that page should go away some day, your answer will have little value. –  Vidar S. Ramdal Aug 4 at 10:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.