ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Increment numbers part of text (https://www.excelbanter.com/excel-discussion-misc-queries/153965-increment-numbers-part-text.html)

Saintsman

Increment numbers part of text
 
How can I add automate quarter year headings?
Q12008
then add 1 to quarter until Q4 & then add 1 to year & restart at Q1 etc
to give:

Q22008
Q32008
Q42008
Q12009

Can anybody help?

Bob Phillips

Increment numbers part of text
 
="Q"&IF(MID(A1,2,1)="4",1,MID(A1,2,1)+1)&IF(MID(A1 ,2,1)="4",RIGHT(A1,4)+1,RIGHT(A1,4))

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Saintsman" wrote in message
...
How can I add automate quarter year headings?
Q12008
then add 1 to quarter until Q4 & then add 1 to year & restart at Q1 etc
to give:

Q22008
Q32008
Q42008
Q12009

Can anybody help?




Saintsman

Increment numbers part of text
 
Many thanks!

"Bob Phillips" wrote:

="Q"&IF(MID(A1,2,1)="4",1,MID(A1,2,1)+1)&IF(MID(A1 ,2,1)="4",RIGHT(A1,4)+1,RIGHT(A1,4))

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Saintsman" wrote in message
...
How can I add automate quarter year headings?
Q12008
then add 1 to quarter until Q4 & then add 1 to year & restart at Q1 etc
to give:

Q22008
Q32008
Q42008
Q12009

Can anybody help?





Dave Peterson

Increment numbers part of text
 
I'd insert a new worksheet (temporarily)
Put this in A1 and drag down:
="Q"&MOD(ROW()-1,4)+1&2008+INT((ROW()-1)/4)

Select what you want
edit|copy
go to where you want it
edit|Paste special|Values

You could even fiddle around with the formula and use it in place...

If I wanted Q12008 to be in X79, I'd use:
="Q"&MOD(ROW()-3,4)+1&1989+INT((ROW()-1)/4)


Saintsman wrote:

How can I add automate quarter year headings?
Q12008
then add 1 to quarter until Q4 & then add 1 to year & restart at Q1 etc
to give:

Q22008
Q32008
Q42008
Q12009

Can anybody help?


--

Dave Peterson


All times are GMT +1. The time now is 07:10 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com