Find the column title

Nite0wls

New Member
Joined
May 21, 2014
Messages
33
Office Version
  1. 2019
  2. 2013
Platform
  1. Windows
Dear Experts,

As newbie I am seeking your help in resolving my challenge for the below task.

I have two tabs in Excel 2010 version.

Tab 1 = "Tel Nr table"
Tab 2 = "IVR Table"

Tel Nr Table
[TABLE="class: outer_border, width: 1237"]
<tbody>[TR]
[TD]Note[/TD]
[TD]IP ROW[/TD]
[TD]DNIS[/TD]
[TD]Country[/TD]
[TD]Languages[/TD]
[TD]Site[/TD]
[TD]IVR[/TD]
[TD]TEST[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]848[/TD]
[TD]5600:crash:[/TD]
[TD]Australia[/TD]
[TD]en-AU[/TD]
[TD]APAC[/TD]
[TD]APAC Main[/TD]
[TD] APAC Main[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]849[/TD]
[TD]5601:crash:[/TD]
[TD]Australia[/TD]
[TD]en-AU[/TD]
[TD]APAC[/TD]
[TD]APAC Main[/TD]
[TD] APAC Main[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]850[/TD]
[TD]5602[/TD]
[TD]Australia[/TD]
[TD]en-AU[/TD]
[TD]APAC[/TD]
[TD] APAC MR Direct Dial[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]851[/TD]
[TD]5603[/TD]
[TD]Australia[/TD]
[TD]en-AU[/TD]
[TD]APAC[/TD]
[TD]APAC Main[/TD]
[TD] APAC Main[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]852[/TD]
[TD]5604[/TD]
[TD]Australia[/TD]
[TD]en-AU[/TD]
[TD]APAC[/TD]
[TD]APAC Main[/TD]
[TD] APAC Main[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]853[/TD]
[TD]5605[/TD]
[TD]Australia[/TD]
[TD]en-AU[/TD]
[TD]APAC[/TD]
[TD]APAC Main[/TD]
[TD] APAC Main[/TD]
[/TR]
</tbody>[/TABLE]


IVR Table
[TABLE="class: outer_border, width: 696"]
<tbody>[TR]
[TD]APAC DR[/TD]
[TD]APAC DR Direct Dial[/TD]
[TD]APAC DR Transfer[/TD]
[TD]APAC Main[/TD]
[TD]APAC MR[/TD]
[TD]APAC MR Direct Dial[/TD]
[/TR]
[TR]
[TD]610012[/TD]
[TD]202[/TD]
[TD]610002[/TD]
[TD]5600:crash:[/TD]
[TD]610013[/TD]
[TD]203[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]5601:crash:[/TD]
[TD][/TD]
[TD]57641202[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]5603[/TD]
[TD][/TD]
[TD]57641211[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]5604[/TD]
[TD][/TD]
[TD]57641218[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]5605[/TD]
[TD][/TD]
[TD]57641241[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]5607[/TD]
[TD][/TD]
[TD]5602[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]5610[/TD]
[TD][/TD]
[TD]5608[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]5611[/TD]
[TD][/TD]
[TD]5613[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]5614[/TD]
[TD][/TD]
[TD]5627[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]5615[/TD]
[TD][/TD]
[TD]5630[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]5616[/TD]
[TD][/TD]
[TD]5635[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]5617[/TD]
[TD][/TD]
[TD]5641[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]5618[/TD]
[TD][/TD]
[TD]5646[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]5620[/TD]
[TD][/TD]
[TD]5657[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]5621[/TD]
[TD][/TD]
[TD]57641245[/TD]
[/TR]
</tbody>[/TABLE]

The task at hand is to extract the title name from each the column on the IVR Table worksheet to the Test column on the Tel nr Table when the numbers on the both worksheets are matching. In each worksheet the number is unique, however not all numbers are nessecarely in the IVR table.

Background is that the IVR Table data is extracted from a system, while the values in the IVR column in the Tel nr Table was manualy added. The IVR has been changed many times and the manual values haven't been updated and I need to know which are out of sync and to correct those that are incorrect.

The both tables have several thousand entries so manually updating this is a nightmare (hence I am typing this at 1 AM)

Thanks for your suggestions.

Nite0wls
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Hello NiteOwl and welcome to the board,

If it is lay out just as you show, And I will assume starting in column A, data in row 2, In the IVR column G on the Tel Nr Table (cell G2 copied down), something like:

=IF(ISNUMBER(MATCH(C2,IVR Table!$D$2:$D$2000,0)),"APAC Main","APAC MR Direct Dial")

Change wher is says '(IVR Table)" to the sheet reference or as appropriate.

If it is a bit more complicated that you have shown, just let me know.
 
Upvote 0
Thanks for the suggestion.

The IVR Table has 150 different column names across with underneeth the corresponding numbers to these names.
The numbers under the columns can go up to 600 numbers deep.

Hence what I try is to match each number column C (DNIS) from the Tel Nr Table with the corresponding number in the IVR Table, once found go to the top column and take the column label and put that label in the Tel Nr Table Test (column H) for the row I found the Tel Nr on. The code provided only works for 2 entries out of a 150 different ones. Since I don't know what nr matches with what IVR Column it is a bit more complicated. It also might be that another IVR is added or one is removed, for which I have to transfer the numbers, so I might need to compare in future again.
 
Last edited:
Upvote 0
NiteOwls,

Try to provide all of your parameters up front so someone isn’t working to give you a solution that doesn’t fit.

Okay, so try this – this is an array formula so must be entered/confirmed with Ctrl+Shift+Enter, not just Enter:

=INDEX('IVR Table'!$A$1:$F$1,MAX(IF('IVR Table'!$A$2:$F$16=C2,COLUMN('IVR Table'!$A$2:$F$16)-COLUMN(A1)+1)))


The above will work if the lookup number is always in the table. If it is not, then use the one below to return “No Match”, for those numbers that are not in the table.


=IF(MAX(IF('IVR Table'!$A$2:$F$16=C2,COLUMN('IVR Table'!$A$2:$F$16)-COLUMN(A1)+1))=0,"No Match",(INDEX('IVR Table'!$A$1:$F$1,MAX(IF('IVR Table'!$A$2:$F$16=C2,COLUMN('IVR Table'!$A$2:$F$16)-COLUMN(A1)+1)))))


I used a range for IVRTable of A1:F16, so change to fit your actual range

I'm not sure if a non array formula will work, but I may explore a bit.
 
Upvote 0
This works great, thank you for that.
Sorry that I didn't make myself clear the first time around.

I found a negative point on this approach as I now manually have to update the formula in all M<row> cells to get the matching C<row> to be checked.
Now I'm wondering if it wouldn't be better to use a macro to scan the list and to update the corresponding fields or am I just thinking to simple?
 
Upvote 0
Hello and no worries.

Code would always be the better choice for something like this if it is an option. I could probably write the code but it would take me a bit to figure it out. There are others on here that could write that bit in a minute or two. If you decide to go that route, I would start a new thread and ask about the VBA code to loop through and do want you want.

Regarding the formula though, what do you mean you have to "manually have to update the formula in all M cells"

Is that a because of the layout/update process. If it is another issue, we may be able to update the formula to accomodate some changes.
 
Upvote 0
Both formula's have a definition for the cell C2 in it (C2,COLUMN) because there are 2000 different nrs I need to copy the cormula in each cell on the M column and update the code with the corresponding row, so C2, C3, C4, C5, etc. for each new row. Copy and past will move also the IVR Table array to a different position.

=IF(MAX(IF('IVR Table'!$A$2:$F$16=C2,COLUMN('IVR Table'!$A$2:$F$16)-COLUMN(A1)+1))=0,"No Match",(INDEX('IVR Table'!$A$1:$F$1,MAX(IF('IVR Table'!$A$2:$F$16=C2,COLUMN('IVR Table'!$A$2:$F$16)-COLUMN(A1)+1)))))
 
Upvote 0
I guess I am not quite following. When you are talking about column M, is that where the formula is? And you are copying the formala down column G, down 2000 rows?

If so, the way the cell referencing is in the formula, C2, with automatically change to C3, C4, C5 and so on, and the Array ranges will stay the same, and not move because those ranges are locked with the Fixed ($) referencing.

Again, I guess I must be missing something, so if you can, give it another go at the problem if you can - maybe a sample layout with the issue would be good.

Thanks
 
Upvote 0
I need to appologize as it is something I must have done wrong. I guess I need to stop working on these things late :( I've redone the copy and this now works as expected.

Thank you very much fo your advise and help.

Nite0wls
 
Upvote 0

Forum statistics

Threads
1,223,239
Messages
6,170,947
Members
452,368
Latest member
jayp2104

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