tag the comment based on criteria

nikhil0311

Board Regular
Joined
May 3, 2013
Messages
197
Office Version
  1. 2013
Platform
  1. Windows

Book1
ABCDE
1IDCountryTime PeriodID+CountryComment
244Malaysia201344MalaysiaOld 2013
322Malaysia201322MalaysiaOld 2013
499Malaysia201399MalaysiaOld 2013
533Hong Kong201433Hong KongNew 2014
644Malaysia201444MalaysiaOld 2013
755Hong Kong201455Hong KongNew 2014
833Hong Kong201533Hong Kongold 2014
966China201566ChinaNew 2015
1033China201533ChinaNew 2015
1122Japan201622JapanNew 2016
1266Japan201666JapanNew 2016
1366China201666ChinaOld 2015
1422Japan201722JapanOld 2016
1555India201755IndiaNew 2017
1611India201711IndiaNew 2017
New Record




Column A has ID. Column B has Country Column C has time period column d has ID+ Country and Column E is the final output.


I want to update column E i.e. comments based on comparision of 2 time periods.For ex

(compare 2014 ID + Country with 2013 ID + Country. If ID+Country is not present in prior year then its "New 2014" else "Old 2013".


Criteria

Compare 2014 Vs 2013 If ID+Country in 2014 is not Present in 2013 then comment should be "New 2014" else "Old 2013"
or
Compare 2015 Vs 2014 If ID+Country in 2015 is not Present in 2014 then comment should be "New 2015" else "Old 2014"
or
Compare 2016 Vs 2015 If ID+Country in 2016 is not Present in 2015 then comment should be "New 2016" else "Old 2015"
or
Compare 2017 Vs 2016 If ID+Country in 2017 is not Present in 2016 then comment should be "New 2017" else "Old 2016"

for 2013 = "-"

let me know if you have any questions!
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
I think I understand correctly, and if I do then this should work. Copy E2 down as necessary. Note that your rows 2,3 and 4 should show "New 2013" according to your declared rule because there is no data for 2012, but I put in a condition that reports Old 2013 if the year is 2013.

E
2Old 2013

<tbody>
</tbody>
Sheet35

Array Formulas
CellFormula
E2{=IF(C2=2013,"Old "&C2,IF(MAX((D2=$D$2:$D$16)*((C2-1)=$C$2:$C$16)),"Old "&C2-1,"New "&C2))}

<tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try to enter the {} manually yourself

<tbody>
</tbody>
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,500
Messages
6,125,168
Members
449,211
Latest member
ykrcory

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