Changing last instance based on multiple column match

justinL

New Member
Joined
Apr 15, 2019
Messages
2
Hello All,

I need to change the last instance of the "yes or no" column to be "yes" if the first two columns match. The prior matching instances would need to be "No".

Below are examples of the data before and after replacing based upon matching column data.


Incorrect:

[TABLE="width: 500"]
<tbody>[TR]
[TD]18225[/TD]
[TD]10
[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]18225[/TD]
[TD]20[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]18225[/TD]
[TD]30[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]18225[/TD]
[TD]30[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]18225[/TD]
[TD]30[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]18225[/TD]
[TD]50[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]19001[/TD]
[TD]10[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]19001[/TD]
[TD]10[/TD]
[TD]No[/TD]
[/TR]
[TR]
[TD]19001[/TD]
[TD]10[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]19001[/TD]
[TD]10[/TD]
[TD]No[/TD]
[/TR]
[TR]
[TD]19001[/TD]
[TD]20[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]19001[/TD]
[TD]20[/TD]
[TD]No[/TD]
[/TR]
[TR]
[TD]19001[/TD]
[TD]20[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]19001[/TD]
[TD]20[/TD]
[TD]Yes[/TD]
[/TR]
</tbody>[/TABLE]

would become if corrected:

[TABLE="width: 500"]
<tbody>[TR]
[TD][TABLE="width: 500"]
<tbody>[TR]
[TD]18225[/TD]
[TD]10
[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]18225[/TD]
[TD]20[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]18225[/TD]
[TD]30[/TD]
[TD]No[/TD]
[/TR]
[TR]
[TD]18225[/TD]
[TD]30[/TD]
[TD]No[/TD]
[/TR]
[TR]
[TD]18225[/TD]
[TD]30[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]18225[/TD]
[TD]50[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]19001[/TD]
[TD]10[/TD]
[TD]No[/TD]
[/TR]
[TR]
[TD]19001[/TD]
[TD]10[/TD]
[TD]No[/TD]
[/TR]
[TR]
[TD]19001[/TD]
[TD]10[/TD]
[TD]No[/TD]
[/TR]
[TR]
[TD]19001[/TD]
[TD]10[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]19001[/TD]
[TD]20[/TD]
[TD]No[/TD]
[/TR]
[TR]
[TD]19001[/TD]
[TD]20[/TD]
[TD]No[/TD]
[/TR]
[TR]
[TD]19001[/TD]
[TD]20[/TD]
[TD]No[/TD]
[/TR]
[TR]
[TD]19001[/TD]
[TD]20[/TD]
[TD]Yes[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

My first time on the forum, bear with me and thanks in advance!

Justin
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Try this:

<table border="1" cellspacing="0" style="font-family:Calibri,Arial; font-size:11pt; background-color:#ffffff; "> <colgroup><col style="font-weight:bold; width:30px; " /><col style="width:76.04px;" /><col style="width:76.04px;" /><col style="width:76.04px;" /></colgroup><tr style="background-color:#cacaca; text-align:center; font-weight:bold; font-size:8pt; "><td > </td><td >A</td><td >B</td><td >C</td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >1</td><td > </td><td > </td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >2</td><td style="text-align:right; ">18225</td><td style="text-align:right; ">10</td><td >Yes</td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >3</td><td style="text-align:right; ">18225</td><td style="text-align:right; ">20</td><td >Yes</td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >4</td><td style="text-align:right; ">18225</td><td style="text-align:right; ">30</td><td >No</td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >5</td><td style="text-align:right; ">18225</td><td style="text-align:right; ">30</td><td >No</td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >6</td><td style="text-align:right; ">18225</td><td style="text-align:right; ">30</td><td >Yes</td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >7</td><td style="text-align:right; ">18225</td><td style="text-align:right; ">50</td><td >Yes</td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >8</td><td style="text-align:right; ">19001</td><td style="text-align:right; ">10</td><td >No</td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >9</td><td style="text-align:right; ">19001</td><td style="text-align:right; ">10</td><td >No</td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >10</td><td style="text-align:right; ">19001</td><td style="text-align:right; ">10</td><td >No</td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >11</td><td style="text-align:right; ">19001</td><td style="text-align:right; ">10</td><td >Yes</td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >12</td><td style="text-align:right; ">19001</td><td style="text-align:right; ">20</td><td >No</td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >13</td><td style="text-align:right; ">19001</td><td style="text-align:right; ">20</td><td >No</td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >14</td><td style="text-align:right; ">19001</td><td style="text-align:right; ">20</td><td >No</td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >15</td><td style="text-align:right; ">19001</td><td style="text-align:right; ">20</td><td >Yes</td></tr></table><br /><table style="font-family:Arial; font-size:10pt; border-style: groove ;border-color:#00ff00;background-color:#fffcf9; color:#000000; "><tr><td ><b></b></td></tr><tr><td ><table border = "1" cellspacing="0" cellpadding="2" style="font-family:Arial; font-size:9pt;"><tr style="background-color:#cacaca; font-size:10pt;"><td >Cell</td><td >Formula</td></tr><tr><td >C2</td><td >=IF(B2=B3,"No","Yes")</td></tr></table></td></tr></table> <br /><br />
 
Upvote 0
Hi Dante,

That worked, looks like I was overthinking that one! I appreciate your help.

Thanks,

Justin
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

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