Finding a value in a multiple column array and returning column header - Excel 2003

NairbNam

New Member
Joined
Dec 7, 2012
Messages
6
Hi guys first post here.

I am attempting to lookup a cell value in a 3 column by 20 row array. Depending on which column the value is found, I would like to return that column's header value.

I think I am making this overly complicated for myself. Basically I need a statement that will perform an Hlookup on three columns but I'm not sure exactly how to do this.

Any help would be appreciated.

Thanks!
 
Can someone please help me with this. I have a table as below. I would like to look up a number (say 3454) and return the number in the 1st column. (2)

ABCDLookupAnswer
112344355634352
256783435
390123
474547234234

<tbody>
</tbody>

<tbody>
</tbody>

Row\Col
A​
B​
C​
D​
E​
G​
H​
I​
J​
K​
1​
ABCDLookupOccurrence CountAnswer
2​
1​
1234​
43556​
3435​
2​
2​
8​
3​
2​
5678​
3435​
234​
1​
4​
4​
3​
90123​
5​
4​
74547​
234​
234​
6​
8​
3435​

In H2 control+shift+enter, not just enter, and copy down:
Rich (BB code):
=SUM(IF(FREQUENCY(IF($B$2:$E$6=$G2,ROW($A$2:$A$6)-ROW($A$2)+1),
    ROW($A$2:$A$6)-ROW($A$2)+1),1))

In I2 control+shift+enter, not just enter, copy across, and down:
Rich (BB code):
=IF(COLUMNS($I2:I2)<=$H2,INDEX($A$2:$A$6,SMALL(IF($B$2:$E$6=$G2,
    ROW($A$2:$A$6)-ROW($A$2)+1),COLUMNS($I2:I2))),"")
 
Upvote 0

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Thank you so much Peter! It Works!
Hi Peter,

Ablebits recommended MrExcel and I found this post very helpful. It's my first time here and would like to seek your help with my query.

I'm building a scorecard with sheets formatted as follows:



Sheet1 (Actual Scores) / Sheet 2 (Monthly Goals)


Roster GroupQuality ScoreAttendanceCSAT %FDR%FRR%IB AHTIB AHT (Sec)IB Abandon %Handle TimeSocMed Mark as ReadSocMed AWT (Hrs)Orders ProcessedChats ReceivedOpen TicketsSolved TicketsExt-PingPong-AllInt-PingPong-AllExt-PingPong-SWATInt-PingPong-SWAT
Digital0.00%100.00%68.75%92.11%15.94% 0.120.00%7.340001083.13%98.08%0.00%0.00%
Digital70.25%95.73%83.33%62.82%46.30% 0.115.580.00%8.400001184.92%94.54%0.00%0.00%
OP85.00%100.00%75.00%73.23%80.21% 0.250.00%14.770269.5002597.22%100.00%0.00%0.00%
GOALS
MonthGroupMetricsGoal ID0%15%30%45%50%65%75%85%90%95%98%100%WeightTarget
MarchDigitalAttendanceMarchDigitalAttendance70%75%80%89%90%92%94%95%96%97%98%100%15.0%90%
MarchDigitalQualityMarchDigitalQuality50%60%65%84%85%88%90%92%94%95%98%100%10.0%85%
MarchDigitalCSATMarchDigitalCSAT50%60%65%72%75%78%81%84%87%90%95%100%20.0%75%
MarchDigitalSolved TicketsMarchDigitalSolved Tickets5745747580--85--9020.0%75
MarchDigitalInt-PingPong-SWATMarchDigitalInt-PingPong-SWAT70%75%80%89%90%92%94%95%96%97%98%100%10.0%90%
MarchDigitalExt-PingPong-SWATMarchDigitalExt-PingPong-SWAT70%75%80%89%90%92%94%95%96%97%98%100%15.0%90%
MarchDigitalTickets assigned >24 hoursMarchDigitalTickets assigned >24 hours987654321--010.0%5

<tbody>
</tbody>

Say I have Digital with Attendance of 95.73%, it will return 85% (based on goal header 0-100%) , multiplied by weight of 15%.

Not sure if this is how I should set this one up though. any advice would surely be appreciated.

Thanks,
Paul
 
Upvote 0
Hi there,

Thanks for the solution here as it really helped me at work. Out of interest though, I typed in a lookup number in Cell E2 and that isn't in the table (e.g. 1000) and it comes back with the result of 'Header 1'. From evaluating the formula it comes up with FALSE for all A2:C5=E2, which turns the IF FALSE, then the MAX is FALSE which in turn is a zero. When the INDEX looks up 0, it returns Header 1.

Any ideas on how to insert an alert into the formula to let you know if the lookup figure isn't in the table of figures?

Thanks!
 
Upvote 0
Hi there, ..
Welcome to the MrExcel board!

There are 52 posts in the thread before yours. It would be sensible to indicate which one you are referring to. ;)

In general though

=IF(COUNTIF(RangeOfInterest,E2),ExistingFormula,"Not found")
 
Upvote 0
This is the only formula that is working for my spreadsheet, hooray! (I've been trying various solutions for the past 5 hours.) However, I'm having an issue with it pulling the EXACT value's column header. (My data consists of zip codes and the headers are different regions.) It is pulling mostly the first column, even if the corresponding zipcode is actually in another column. Help!

Try this...

Sheet1

ABCDEF
1Header1Header2Header3_LookupLocation
2221065_94Header2
3441559___
4489431___
5332986___

<colgroup><col style="font-weight:bold; width:30px; "><col style="width:72px;"><col style="width:72px;"><col style="width:72px;"><col style="width:20px;"><col style="width:72px;"><col style="width:72px;"></colgroup><tbody>
</tbody>

This array formula** entered in F2:

=INDEX(A1:C1,MAX(IF(A2:C5=E2,COLUMN(A2:C5)-COLUMN(A1)+1)))

** array formulas need to be entered using the key
combination of CTRL,SHIFT,ENTER (not just ENTER).
Hold down both the CTRL key and the SHIFT key
then hit ENTER.
 
Upvote 0
This is the only formula that is working for my spreadsheet, hooray! (I've been trying various solutions for the past 5 hours.) However, I'm having an issue with it pulling the EXACT value's column header. (My data consists of zip codes and the headers are different regions.) It is pulling mostly the first column, even if the corresponding zipcode is actually in another column. Help!

Care to post a small sample along with expected output?
 
Upvote 0
Care to post a small sample along with expected output?

I'd love to! So a sheet called Regions holds the Zipcode Region Table:

Region 1Region 2Region 3Region 4Region 5Region 6Region 7
53007530055301853001532016080453103
53017530455302953004532026071453105
53022531225305853010532036071253115
53027531465306653011532046070753119
53033531515306953011532056070653120
53037532085307253012532066070653120
53046532105311853013532096066653121
53051532135312753014532116066153128
53076532145318353014532125310453139
53086532155318653015532175310853147
53089532225318853015532235311053147
53095532265318953019532245312653149
53216532275353853019532335312953150
532185323353598530205313053150
5322554626530215313253153
53956530215314053156
53006530235314253157
530245314353168
530405314453185
530405315453190

<tbody>
</tbody>

The table is much larger than this, as several of the columns have more zipcodes/data.

Other sheets (named by months) contain names of customers, their info and when I type in their zipcode, I have a cell next to it with the formula that I want it to pull what region the zipcode belongs to. Here is the formula that I created based on the original thread that works for some, but not all cells: =INDEX(Regions!$A$1:$K$1,MAX(IF(Regions!$A48:K$250=June!M64,COLUMN(Regions!$A$2:$K$250)-COLUMN(Regions!A47)+1)))

I used the ctrl/shift/enter for the formula.

So for example, zipcode 53208 is in Region 2 and should pull that header, but it doesn't, it pulls Region 1. Another one is 53149 which is in Region 6, but it also pulls Region 1. This is happening a lot, pulling some correct headings, some incorrect headings. I think I know why it is happening but I cannot figure out how to fix it. Your help is most appreciated!
 
Upvote 0
I'm not an excel whizzkid but it might be duplicates that are upsetting your results.
 
Upvote 0

Forum statistics

Threads
1,215,253
Messages
6,123,891
Members
449,131
Latest member
leobueno

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