# Posts by BJL

• ## When G matches B, count the number of values in C (that do not match H)

Re: When G matches B, count the number of values in C (that do not match H)

Yes, Thank you!

• ## When G matches B, count the number of values in C (that do not match H)

Re: When G matches B, count the number of values in C (that do not match H)

Quote from NBVC;790743

Try these formulas copied down

=SUMPRODUCT((\$B\$2:\$B\$324=G2)*(\$C\$2:\$C\$324<>H2)/COUNTIFS(\$B\$2:\$B\$324,\$B\$2:\$B\$324&"",\$C\$2:\$C\$324,\$C\$2:\$C\$324&""))

=SUMPRODUCT((\$B\$2:\$B\$324=G2)*(\$C\$2:\$C\$324<>H2)*(\$E\$2:\$E\$324="MTY")/COUNTIFS(\$B\$2:\$B\$324,\$B\$2:\$B\$324&"",\$C\$2:\$C\$324,\$C\$2:\$C\$324&"",\$E\$2:\$E\$324,\$E\$2:\$E\$324&""))

Yes! It's working.

But I notice one flaw in my own description of the problem. I also want to specify that the MPN Status in column D should be either "RL" or "SR" as well, because an MPN shouldn't count if it's already blocked. Likewise if multiple MPNs are linked to the same component (like G2 and G3) then both need to be excluded from the final count in columns J and K...

I think I know how to do it, too...

=SUMPRODUCT((\$B\$2:\$B\$324=G2)*(\$C\$2:\$C\$324<>H2)*(\$D\$2:\$D\$324="RL")/COUNTIFS(\$B\$2:\$B\$324,\$B\$2:\$B\$324&"",\$C\$2:\$C\$324,\$C\$2:\$C\$324&"",\$D\$2:\$D\$324,\$D\$2:\$D\$324&""))

But how can I include "SR" in the formula, too?

• ## When G matches B, count the number of values in C (that do not match H)

Re: When G matches B, count the number of values in C (that do not match H)

edit

• ## When G matches B, count the number of values in C (that do not match H)

Hello,

Column H is a list of six-digit MPNs to be blocked, and Column G shows the component that the MPN relates to. So, within the list of components (columns A:E), I need to count the number of MPNs each Component has...but not including the ones to be blocked (column H). So, if there are 4 different MPN numbers; I want to show that in column J. Then, in column K, I want to show how many of those MPNs have the location of "MTY."

So, I'm just trying to find a formula for columns J and K....

I provided an example in the picture below:
H2 is the first MPN in the list. So, G2 must match B:B (I highlighted the matching component in red). So, I want to count the related MPNs in column C...but excluding the ones where C matches H (highlighted in yellow). You can see I counted the different MPNs from 1-to-4 in blue (I skipped the one in yelow) and I listed that final count in column J. Likewise, I counted column E, where the location was "MTY" and listed the final count in Column K.
[Blocked Image: http://i26.photobucket.com/albums/c117/shocktrooper327/Excel%20Example_zpso4wlcouf.png]

forum.ozgrid.com/index.php?attachment/72217/

• ## Marco to Insert Objects onto spreadsheet without them overlapping eachother

Re: Marco to Insert Objects onto spreadsheet without them overlapping eachother

Perfect! Thank you! :flower:

• ## Marco to Insert Objects onto spreadsheet without them overlapping eachother

I want to put 30+ .jpg pictures into a spreadsheet. I have them all in one folder too. I want to have a column of the objects, so that you just have to double click on one to view it.

Using Insert > Object > Create from File makes it easy to do one jpg at a time, but I hoping to use a macro to make it easier. I googled it, and came across a pretty nice solution here and here using the same macro, but the macro has a problem where the objects are all on top of one another.

This picture is pretty much what I want the spreadsheet to look like, only with jpg instead of txt files

[ATTACH=CONFIG]67973[/ATTACH]

• ## Align two sets of data by matching Order#; then align different dates of matching #s

Re: Align two sets of data by matching Order#; then align different dates of matching

Oh, wow. Yeah, I didn't even notice row 187, that was a mistake on my part. But you got it as I actually wanted it with the macro. Awesome, awesome job. Thank you!

• ## Align two sets of data by matching Order#; then align different dates of matching #s

Re: Align two sets of data by matching Order#; then align different dates of matching

Much improved with the new macro, but two problems remain; the dates in the C and F columns don't seem to align properly within a group of matching Sales Orders, and once you go past row 500 the formatting is different (dates show up as 5-digit numbers in a general format).

Also, I noticed that when I tried to use the macro in my actual spread sheet with 12,000+ rows, I got this minor pop up that highlights this error:

[ATTACH=CONFIG]65470[/ATTACH]

But the good side is that no cells seems to be deleted, and the only un-matched SO#s are the ones with no duplicate.

• ## Align two sets of data by matching Order#; then align different dates of matching #s

Re: Align two sets of data by matching Order#; then align different dates of matching

My apologies, I'm absolutely on board with how you're trying to help. So, I took the same excel spread sheet and put in my desired results:

The first page has untouched data, page 2 has the results with the macro (where I briefly point out examples of what's off), page 3 has my desired results (with brief description).

• ## Align two sets of data by matching Order#; then align different dates of matching #s

Re: Align two sets of data by matching Order#; then align different dates of matching

So, I just used the macro on my original copy of the "Scrubbed Test Data xlsx" that I uploaded in my first post here; the only difference is that my uploaded xlsx is only 500 rows long because my original has exactly 12669 rows of data (and it wouldn't upload). So, I just used the macro on it. Sure enough, everything seems perfect until I reach row 12669. Then the cells lose their formatting and aren't matched or aligned with anything.

• ## Align two sets of data by matching Order#; then align different dates of matching #s

Re: Align two sets of data by matching Order#; then align different dates of matching

Hmm. I'm not sure what you mean. When results of the macro are within the first 500 rows it seems to be perfect. Everything aligns the way I hoped.

It's just that all cells pushed below row 500 (the original dim?), the macro no longer notices it. I think it's just cells, that weren't originally bound to a matching value, then get pushed below row 500, that's all. I don't know vba, but isn't it just a matter of the original range or dim being aligned with the original length of the sheet (row 500)? With the blank spaces (which I like!) cells are going to end up below row 500.

Which, I'm guessing, is why the below formatting isn't recognized in regards to any cells below row 500.
With .Cells(2, 5)
myStyle = .Font.FontStyle
myInterior = .Interior.Color
myColor = .Font.Color

• ## Align two sets of data by matching Order#; then align different dates of matching #s

Re: Align two sets of data by matching Order#; then align different dates of matching

It's seems to be almost exactly what I was looking for, but there seems to be a problem...

I think once any data gets pushed outside of the originally established dimension (Dim a, i As Long, etc) then those cells no longer get looked at by the macro. But, I may be way off...

I suspected it because at the bottom of the worksheet, after I use the macro, there is a good chunk of displaced data in columns E & F. When I first opened the attached excel file and used the macro, I thought the displaced data - since it was just in E & F - was merely Sales Order #s that had no duplicate in column A (because I deleted everything in that upload that went past row 500). But I did a Ctrl-f search of the displaced Order #s in column E and actually found matching numbers in column A. But, I did notice that the date of the displaced Order # did not match the dates of its duplicate from above. So maybe that's why it ended up there? The start dates that don't match get shifted down, and if it falls outside the original dimension, the macro no longer looks at it? Too add to that, I also noticed the formatting was stripped on those displaced cells and that started at exactly row 501 and down.

• ## Align two sets of data by matching Order#; then align different dates of matching #s

So, I want to match and align the corresponding Sales Order #s in each set of data...but then match the start date of the contract on the left with the date of its corresponding sales order in the last column. So this is like finding a matching value within a matching value.

Here's the basic scrubbed data. For this example, I underlined the matching Sales Orders that should be aligned, and after that, the dates (in bold below) need to be aligned...which is a problem because the dates - even for the same sales order # - can be different.

[TABLE="class: cms_table"]

[tr]

[TD="class: cms_table_xl70"]Sales Order #
[/TD]
[TD="class: cms_table_xl70"]Contract #[/TD]
[TD="class: cms_table_xl70"]Start Date[/TD]
[TD="class: cms_table_xl70"]End Date[/TD]
[TD="class: cms_table_xl70, width: 88"]Sales Order #
[/TD]
[TD="class: cms_table_xl70, width: 111"]Sales Order Date[/TD]

[/tr]

[tr]

[TD="class: cms_table_xl66, align: right"]6101479214[/TD]
[TD="class: cms_table_xl66, align: right"]54027626[/TD]
[TD="class: cms_table_xl67, align: right"]7/13/2011[/TD]
[TD="class: cms_table_xl67, align: right"]12/18/2019[/TD]
[TD="class: cms_table_xl68, align: right"]6101479214[/TD]
[TD="class: cms_table_xl69, align: right"]7/13/2011[/TD]

[/tr]

[tr]

[TD="class: cms_table_xl66, align: right"]6101485835[/TD]
[TD="class: cms_table_xl66, align: right"]54952166[/TD]
[TD="class: cms_table_xl67, align: right"]11/9/2011[/TD]
[TD="class: cms_table_xl67, align: right"]12/30/2019[/TD]
[TD="class: cms_table_xl68, align: right"]6101485835[/TD]
[TD="class: cms_table_xl69, align: right"]11/9/2011[/TD]

[/tr]

[tr]

[TD="class: cms_table_xl66, align: right"]6101486137[/TD]
[TD="class: cms_table_xl66, align: right"]55073527[/TD]
[TD="class: cms_table_xl67, align: right"]11/23/2011[/TD]
[TD="class: cms_table_xl67, align: right"]10/29/2020[/TD]
[TD="class: cms_table_xl68, align: right"]6101486137[/TD]
[TD="class: cms_table_xl69, align: right"]11/23/2011
[/TD]

[/tr]

[tr]

[TD="class: cms_table_xl66, align: right"]6101486679
[/TD]
[TD="class: cms_table_xl66, align: right"]55206820[/TD]
[TD="class: cms_table_xl67, align: right"]12/7/2011[/TD]
[TD="class: cms_table_xl67, align: right"]12/5/2019[/TD]
[TD="class: cms_table_xl68, align: right"]6101486679[/TD]
[TD="class: cms_table_xl69, align: right"]12/7/2011
[/TD]

[/tr]

[tr]

[TD="class: cms_table_xl66, align: right"]6101486679
[/TD]
[TD="class: cms_table_xl66, align: right"]55187822[/TD]
[TD="class: cms_table_xl67, align: right"]12/7/2011[/TD]
[TD="class: cms_table_xl67, align: right"]12/5/2019[/TD]
[TD="class: cms_table_xl68, align: right"]6101487377
[/TD]
[TD="class: cms_table_xl69, align: right"]12/6/2011
[/TD]

[/tr]

[tr]

[TD="class: cms_table_xl66, align: right"]6101487377
[/TD]
[TD="class: cms_table_xl66, align: right"]55189203[/TD]
[TD="class: cms_table_xl67, align: right"]12/6/2011[/TD]
[TD="class: cms_table_xl67, align: right"]12/4/2019[/TD]
[TD="class: cms_table_xl68, align: right"]6101487648[/TD]
[TD="class: cms_table_xl69, align: right"]12/30/2011[/TD]

[/tr]

[tr]

[TD="class: cms_table_xl66, align: right"]6101487377[/TD]
[TD="class: cms_table_xl66, align: right"]55174785[/TD]
[TD="class: cms_table_xl67, align: right"]12/5/2011[/TD]
[TD="class: cms_table_xl67, align: right"]12/4/2019[/TD]
[TD="class: cms_table_xl68, align: right"]6101487703[/TD]
[TD="class: cms_table_xl69, align: right"]12/15/2011[/TD]

[/tr]

[tr]

[TD="class: cms_table_xl66, align: right"]6101487648[/TD]
[TD="class: cms_table_xl66, align: right"]55428788[/TD]
[TD="class: cms_table_xl67, align: right"]12/30/2011[/TD]
[TD="class: cms_table_xl67, align: right"]1/3/2020[/TD]
[TD="class: cms_table_xl68, align: right"]6101488006[/TD]
[TD="class: cms_table_xl69, align: right"]12/12/2011[/TD]

[/tr]

[tr]

[TD="class: cms_table_xl66, align: right"]6101487703[/TD]
[TD="class: cms_table_xl66, align: right"]55272346[/TD]
[TD="class: cms_table_xl67, align: right"]12/15/2011[/TD]
[TD="class: cms_table_xl67, align: right"]12/13/2019[/TD]
[TD="class: cms_table_xl68, align: right"]6101488109[/TD]
[TD="class: cms_table_xl69, align: right"]1/10/2012[/TD]

[/tr]

[/TABLE]

So, this is as far as I've gotten. The Sales Orders are aligned as I like (underlined below), but I need to do the same with the corresponding dates (in bold) cause sometimes the dates match, sometimes they don't. Since there are multiple dates, I'm wondering if there's a way to do the True/False comparison. Normally I could do that with a simple formula. But since even the matching orders can have duplicates, it will probably be met with blank cells to it's direct left or right. So, I'm wondering if there's a way to do a more advanced kind of True/False comparison to pick apart which ones match.

(Below, I'm using a different chunk of Sales orders than I used above to hopefully make my point clearer)

[TABLE="class: cms_table"]

[tr]

[TD="class: cms_table_xl66"]Sales Order #
[/TD]
[TD="class: cms_table_xl66, width: 69"]Contract #[/TD]
[TD="class: cms_table_xl66, width: 73"]Start Date[/TD]
[TD="class: cms_table_xl66, width: 66"]End Date[/TD]
[TD="class: cms_table_xl66, width: 88"]Sales Order #
[/TD]
[TD="class: cms_table_xl66, width: 111"]Sales Order Date[/TD]

[/tr]

[tr]

[TD="class: cms_table_xl69, align: right"]6300740128
[/TD]
[TD="class: cms_table_xl69, align: right"]52591614[/TD]
[TD="class: cms_table_xl70, align: right"]3/4/2013
[/TD]
[TD="class: cms_table_xl70, align: right"]3/3/2021[/TD]
[TD="class: cms_table_xl67, align: right"]6300740128[/TD]
[TD="class: cms_table_xl68, align: right"]12/10/2010[/TD]

[/tr]

[tr]

[TD="class: cms_table_xl69"]
[/TD]
[TD="class: cms_table_xl69"]
[/TD]
[TD="class: cms_table_xl70"]
[/TD]
[TD="class: cms_table_xl70"]
[/TD]
[TD="class: cms_table_xl67, align: right"]6300740128[/TD]
[TD="class: cms_table_xl68, align: right"]12/11/2010
[/TD]

[/tr]

[tr]

[TD="class: cms_table_xl69, align: right"]6300751301[/TD]
[TD="class: cms_table_xl69, align: right"]52747989[/TD]
[TD="class: cms_table_xl70, align: right"]12/6/2011[/TD]
[TD="class: cms_table_xl70, align: right"]3/13/2016[/TD]
[TD="class: cms_table_xl67, align: right"]6300751301[/TD]
[TD="class: cms_table_xl68, align: right"]12/30/2010[/TD]

[/tr]

[tr]

[TD="class: cms_table_xl69, align: right"]6300753393[/TD]
[TD="class: cms_table_xl69, align: right"]52747068[/TD]
[TD="class: cms_table_xl70, align: right"]12/30/2010[/TD]
[TD="class: cms_table_xl70, align: right"]5/15/2021[/TD]
[TD="class: cms_table_xl67, align: right"]6300753393[/TD]
[TD="class: cms_table_xl68, align: right"]12/30/2010[/TD]

[/tr]

[tr]

[TD="class: cms_table_xl69"]
[/TD]
[TD="class: cms_table_xl69"]
[/TD]
[TD="class: cms_table_xl70"]
[/TD]
[TD="class: cms_table_xl70"]
[/TD]
[TD="class: cms_table_xl67, align: right"]6300753393[/TD]
[TD="class: cms_table_xl68, align: right"]12/30/2010[/TD]

[/tr]

[tr]

[TD="class: cms_table_xl69"]
[/TD]
[TD="class: cms_table_xl69"]
[/TD]
[TD="class: cms_table_xl70"]
[/TD]
[TD="class: cms_table_xl70"]
[/TD]
[TD="class: cms_table_xl67, align: right"]6300753393[/TD]
[TD="class: cms_table_xl68, align: right"]12/30/2010[/TD]

[/tr]

[tr]

[TD="class: cms_table_xl69, align: right"]6300759135
[/TD]
[TD="class: cms_table_xl69, align: right"]52827765[/TD]
[TD="class: cms_table_xl70, align: right"]1/13/2011[/TD]
[TD="class: cms_table_xl70, align: right"]7/28/2021[/TD]
[TD="class: cms_table_xl67, align: right"]6300759135[/TD]
[TD="class: cms_table_xl68, align: right"]1/13/2011[/TD]

[/tr]

[tr]

[TD="class: cms_table_xl69, align: right"]6300759135[/TD]
[TD="class: cms_table_xl69, align: right"]52814196[/TD]
[TD="class: cms_table_xl70, align: right"]1/13/2011[/TD]
[TD="class: cms_table_xl70, align: right"]5/19/2021[/TD]
[TD="class: cms_table_xl67"]
[/TD]
[TD="class: cms_table_xl68"]
[/TD]

[/tr]

[tr]

[TD="class: cms_table_xl69, align: right"]6300759408[/TD]
[TD="class: cms_table_xl69, align: right"]52780811[/TD]
[TD="class: cms_table_xl70, align: right"]1/7/2011[/TD]
[TD="class: cms_table_xl70, align: right"]12/7/2019[/TD]
[TD="class: cms_table_xl67, align: right"]6300759408[/TD]
[TD="class: cms_table_xl68, align: right"]1/7/2011[/TD]

[/tr]

[/TABLE]

If it matters, or if it's of any help, the below vba, is my source for where I'm currently at with the above example. I've used this vba in the past for other projects (but with just one match). I'm not sure if it's the right approach for what I currently need, though.

I have also attached an excel file. This one is smaller and scrubbed; My real file has over 12,000 rows.
forum.ozgrid.com/index.php?attachment/65410/

• ## trial

Re: trial

Align two sets of data by matching Order#; then align different dates of matching #s

Here's a sample of the basic scrubbed data. One set of data is in the first 4 columns, the second set of data is in the last two columns (in a different text color). I'm basically comparing a list of contracts in the first 4 columns on the left (with it's corresponding Sales Order # as the key matching value in the 1st column) to the original Sales Order in the last two columns on the right. I want to match and align the corresponding Sales Order #s in each set of data...and then match the start date of the contract on the left with the date of its corresponding sales order in the last column. So this is like finding a matching value within a corresponding matching value.

What's especially tricky about this is that there are duplicate Sales Order #s in both data sets. Why? Because, different contract #s can come from the same corresponding Sales Order # (and those different contract #s can have different start dates too :wink: ). On the other end, the same Sales Order can have multiple rows (essentially duplicate Order #s, but with potentially different dates). And I want to align the Order #s and align the dates of those matching Order #s. So below, to try and make my problem clearer, I underlined the matching Sales Orders #s that should be aligned, and put in bold how the corresponding dates can also be different.

[TABLE="class: cms_table"]

[tr]

[TD="class: cms_table_xl70"]Sales Order #
[/TD]
[TD="class: cms_table_xl70"]Contract #[/TD]
[TD="class: cms_table_xl70"]Start Date[/TD]
[TD="class: cms_table_xl70"]End Date[/TD]
[TD="class: cms_table_xl70, width: 88"]Sales Order #
[/TD]
[TD="class: cms_table_xl70, width: 111"]Sales Order Date[/TD]

[/tr]

[tr]

[TD="class: cms_table_xl66, align: right"]6101479214[/TD]
[TD="class: cms_table_xl66, align: right"]54027626[/TD]
[TD="class: cms_table_xl67, align: right"]7/13/2011[/TD]
[TD="class: cms_table_xl67, align: right"]12/18/2019[/TD]
[TD="class: cms_table_xl68, align: right"]6101479214[/TD]
[TD="class: cms_table_xl69, align: right"]7/13/2011[/TD]

[/tr]

[tr]

[TD="class: cms_table_xl66, align: right"]6101485835[/TD]
[TD="class: cms_table_xl66, align: right"]54952166[/TD]
[TD="class: cms_table_xl67, align: right"]11/9/2011[/TD]
[TD="class: cms_table_xl67, align: right"]12/30/2019[/TD]
[TD="class: cms_table_xl68, align: right"]6101485835[/TD]
[TD="class: cms_table_xl69, align: right"]11/9/2011[/TD]

[/tr]

[tr]

[TD="class: cms_table_xl66, align: right"]6101486137[/TD]
[TD="class: cms_table_xl66, align: right"]55073527[/TD]
[TD="class: cms_table_xl67, align: right"]11/23/2011[/TD]
[TD="class: cms_table_xl67, align: right"]10/29/2020[/TD]
[TD="class: cms_table_xl68, align: right"]6101486137[/TD]
[TD="class: cms_table_xl69, align: right"]11/23/2011
[/TD]

[/tr]

[tr]

[TD="class: cms_table_xl66, align: right"]6101486679
[/TD]
[TD="class: cms_table_xl66, align: right"]55206820[/TD]
[TD="class: cms_table_xl67, align: right"]12/7/2011[/TD]
[TD="class: cms_table_xl67, align: right"]12/5/2019[/TD]
[TD="class: cms_table_xl68, align: right"]6101486679[/TD]
[TD="class: cms_table_xl69, align: right"]12/7/2011
[/TD]

[/tr]

[tr]

[TD="class: cms_table_xl66, align: right"]6101486679
[/TD]
[TD="class: cms_table_xl66, align: right"]55187822[/TD]
[TD="class: cms_table_xl67, align: right"]12/7/2011[/TD]
[TD="class: cms_table_xl67, align: right"]12/5/2019[/TD]
[TD="class: cms_table_xl68, align: right"]6101487377
[/TD]
[TD="class: cms_table_xl69, align: right"]12/6/2011
[/TD]

[/tr]

[tr]

[TD="class: cms_table_xl66, align: right"]6101487377
[/TD]
[TD="class: cms_table_xl66, align: right"]55189203[/TD]
[TD="class: cms_table_xl67, align: right"]12/6/2011[/TD]
[TD="class: cms_table_xl67, align: right"]12/4/2019[/TD]
[TD="class: cms_table_xl68, align: right"]6101487648[/TD]
[TD="class: cms_table_xl69, align: right"]12/30/2011[/TD]

[/tr]

[tr]

[TD="class: cms_table_xl66, align: right"]6101487377[/TD]
[TD="class: cms_table_xl66, align: right"]55174785[/TD]
[TD="class: cms_table_xl67, align: right"]12/5/2011[/TD]
[TD="class: cms_table_xl67, align: right"]12/4/2019[/TD]
[TD="class: cms_table_xl68, align: right"]6101487703[/TD]
[TD="class: cms_table_xl69, align: right"]12/15/2011[/TD]

[/tr]

[tr]

[TD="class: cms_table_xl66, align: right"]6101487648[/TD]
[TD="class: cms_table_xl66, align: right"]55428788[/TD]
[TD="class: cms_table_xl67, align: right"]12/30/2011[/TD]
[TD="class: cms_table_xl67, align: right"]1/3/2020[/TD]
[TD="class: cms_table_xl68, align: right"]6101488006[/TD]
[TD="class: cms_table_xl69, align: right"]12/12/2011[/TD]

[/tr]

[tr]

[TD="class: cms_table_xl66, align: right"]6101487703[/TD]
[TD="class: cms_table_xl66, align: right"]55272346[/TD]
[TD="class: cms_table_xl67, align: right"]12/15/2011[/TD]
[TD="class: cms_table_xl67, align: right"]12/13/2019[/TD]
[TD="class: cms_table_xl68, align: right"]6101488109[/TD]
[TD="class: cms_table_xl69, align: right"]1/10/2012[/TD]

[/tr]

[/TABLE]

So, below is as far as I've gotten with the below vba. The Sales Orders are aligned(underlined below), which is what I like, but I need to do the same with the corresponding dates (in bold); cause sometimes the dates match, and sometimes they don't.
The Blank spaces are going to be needed (I think) due to the duplicates, but it does make matching dates tougher. As a result, the biggest part of this project is to compare the Contract start date to the original Sales Order date. See, normally I could do that with a simple formula. But since even the matching orders can have duplicates, it will probably be met with blank cells to it's direct left or right. So, I'm wondering if there's a way to do a more advanced kind of True/False comparison to pick apart which ones match.

(Below, I'm using a different chunk of Sales orders than I used above to hopefully make my point clearer. But basically, I like how the Sales Orders match, and I'd like the dates to align as well...and maybe get a True/False comparison to confirm the match in the next column over. Just so it stands out.)

[TABLE="class: cms_table"]

[tr]

[TD="class: cms_table_xl66"]Sales Order #
[/TD]
[TD="class: cms_table_xl66, width: 69"]Contract #[/TD]
[TD="class: cms_table_xl66, width: 73"]Start Date[/TD]
[TD="class: cms_table_xl66, width: 66"]End Date[/TD]
[TD="class: cms_table_xl66, width: 88"]Sales Order #
[/TD]
[TD="class: cms_table_xl66, width: 111"]Sales Order Date[/TD]

[/tr]

[tr]

[TD="class: cms_table_xl69, align: right"]6300740128
[/TD]
[TD="class: cms_table_xl69, align: right"]52591614[/TD]
[TD="class: cms_table_xl70, align: right"]3/4/2013
[/TD]
[TD="class: cms_table_xl70, align: right"]3/3/2021[/TD]
[TD="class: cms_table_xl67, align: right"]6300740128[/TD]
[TD="class: cms_table_xl68, align: right"]12/10/2010[/TD]

[/tr]

[tr]

[TD="class: cms_table_xl69"]
[/TD]
[TD="class: cms_table_xl69"]
[/TD]
[TD="class: cms_table_xl70"]
[/TD]
[TD="class: cms_table_xl70"]
[/TD]
[TD="class: cms_table_xl67, align: right"]6300740128[/TD]
[TD="class: cms_table_xl68, align: right"]12/11/2010
[/TD]

[/tr]

[tr]

[TD="class: cms_table_xl69, align: right"]6300751301[/TD]
[TD="class: cms_table_xl69, align: right"]52747989[/TD]
[TD="class: cms_table_xl70, align: right"]12/6/2011[/TD]
[TD="class: cms_table_xl70, align: right"]3/13/2016[/TD]
[TD="class: cms_table_xl67, align: right"]6300751301[/TD]
[TD="class: cms_table_xl68, align: right"]12/30/2010[/TD]

[/tr]

[tr]

[TD="class: cms_table_xl69, align: right"]6300753393[/TD]
[TD="class: cms_table_xl69, align: right"]52747068[/TD]
[TD="class: cms_table_xl70, align: right"]12/30/2010[/TD]
[TD="class: cms_table_xl70, align: right"]5/15/2021[/TD]
[TD="class: cms_table_xl67, align: right"]6300753393[/TD]
[TD="class: cms_table_xl68, align: right"]12/30/2010[/TD]

[/tr]

[tr]

[TD="class: cms_table_xl69"]
[/TD]
[TD="class: cms_table_xl69"]
[/TD]
[TD="class: cms_table_xl70"]
[/TD]
[TD="class: cms_table_xl70"]
[/TD]
[TD="class: cms_table_xl67, align: right"]6300753393[/TD]
[TD="class: cms_table_xl68, align: right"]12/30/2010[/TD]

[/tr]

[tr]

[TD="class: cms_table_xl69"]
[/TD]
[TD="class: cms_table_xl69"]
[/TD]
[TD="class: cms_table_xl70"]
[/TD]
[TD="class: cms_table_xl70"]
[/TD]
[TD="class: cms_table_xl67, align: right"]6300753393[/TD]
[TD="class: cms_table_xl68, align: right"]12/30/2010[/TD]

[/tr]

[tr]

[TD="class: cms_table_xl69, align: right"]6300759135
[/TD]
[TD="class: cms_table_xl69, align: right"]52827765[/TD]
[TD="class: cms_table_xl70, align: right"]1/13/2011[/TD]
[TD="class: cms_table_xl70, align: right"]7/28/2021[/TD]
[TD="class: cms_table_xl67, align: right"]6300759135[/TD]
[TD="class: cms_table_xl68, align: right"]1/13/2011[/TD]

[/tr]

[tr]

[TD="class: cms_table_xl69, align: right"]6300759135[/TD]
[TD="class: cms_table_xl69, align: right"]52814196[/TD]
[TD="class: cms_table_xl70, align: right"]1/13/2011[/TD]
[TD="class: cms_table_xl70, align: right"]5/19/2021[/TD]
[TD="class: cms_table_xl67"]
[/TD]
[TD="class: cms_table_xl68"]
[/TD]

[/tr]

[tr]

[TD="class: cms_table_xl69, align: right"]6300759408[/TD]
[TD="class: cms_table_xl69, align: right"]52780811[/TD]
[TD="class: cms_table_xl70, align: right"]1/7/2011[/TD]
[TD="class: cms_table_xl70, align: right"]12/7/2019[/TD]
[TD="class: cms_table_xl67, align: right"]6300759408[/TD]
[TD="class: cms_table_xl68, align: right"]1/7/2011[/TD]

[/tr]

[/TABLE]

If it matters, or if it's of any help, the below vba, is my source for where I'm currently at with the above example. I've used this vba in the past for other projects (but with just one match). I'm not sure if it's the right approach for what I currently need, though. I've been searching around and trying too add a step to this vba to solve my problem, but I might be approaching it wrong (Maybe because it sorts and shifts down if it doesn't get a match? That's why?). But, I will say, that vbareally is super easy for someone like me to play around with and edit so that I can use different sets of data with different ranges -- I've just never used it for something like my current project with two values to match. And this is the type of project I'll be working on in the future (with more or less columns of data). So, anyone can solve my problem I hope you don't mind showing me how to

• ## Custom BB Code Tests

Re: Custom BB Code Tests

Here's the basic scrubbed data. For this example, I underlined the matching Sales Orders that should be aligned, and after that, the dates (in bold below) need to be aligned...which is a problem because the dates - even for the same sales order # - can be different.

So, this is as far as I've gotten. The Sales Orders are aligned as I like (underlined below), but I need to do the same with the corresponding dates (in bold) cause sometimes the dates match, sometimes they don't. Since there are multiple dates, I'm wondering if there's a way to do the True/False comparison. Normally that would be easy, but the blanks (which are still ok) make that harder.

(Below, I'm using a different chunk of Sales orders than I used above to hopefully make my point clearer)

Below, is my source for where I'm currently at. Not sure if it's the right approach for what I currently need, though...