Cell value reverts to 'Q1' if value in another column changes

fingermouse

Board Regular
Joined
Dec 13, 2013
Messages
117
As per the question, i have two columns, one entitled 'ref no' and another entitled 'qtr'.

There are about 400 rows in the sheet, with multiple ref numbers.

What I want to do is revert to a value of 'Q1' in the 'qtr' column every time the 'ref no' column value changes. (text in red)

How can this be done?

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Ref no[/TD]
[TD]Qtr[/TD]
[/TR]
[TR]
[TD]001[/TD]
[TD]Q1[/TD]
[/TR]
[TR]
[TD]001[/TD]
[TD]Q2[/TD]
[/TR]
[TR]
[TD]001[/TD]
[TD]Q3[/TD]
[/TR]
[TR]
[TD]001[/TD]
[TD]Q4[/TD]
[/TR]
[TR]
[TD]001[/TD]
[TD]Q1[/TD]
[/TR]
[TR]
[TD]001[/TD]
[TD]Q2[/TD]
[/TR]
[TR]
[TD]001[/TD]
[TD]Q3[/TD]
[/TR]
[TR]
[TD]002[/TD]
[TD]Q1[/TD]
[/TR]
[TR]
[TD]002[/TD]
[TD]Q2[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Looks longer than necessary but works ok. Put this in B2 and copy down:

=IF(OR(NOT(ISNUMBER(0+SUBSTITUTE(B1,"Q",""))),B1="Q4",A2<>A1),"Q1","Q"&SUBSTITUTE(B1,"Q","")+1)
 
Upvote 0
And here is another option that you can try:


Excel 2013/2016
AB
1Ref noQtr
2001Q1
3001Q2
4001Q3
5001Q4
6001Q1
7001Q2
8001Q3
9002Q1
10002Q2
Sheet1
Cell Formulas
RangeFormula
B2=IF(OR(A2<>A1,B1="Q4"),"Q1","Q" & RIGHT(B1)+1)
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,248
Members
452,623
Latest member
cliftonhandyman

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top