Nested IFs Problem

tony0682

Board Regular
Joined
May 19, 2005
Messages
164
I have a spreadsheet where there are 10 headers with 50 different row items. Lets just say the headers are the names of banks and the rows are the ticker symbols for stocks. When I get a price from a specific bank I put the price in the matching cell. What I am comparing is a price I originally have from my own portfolio.

If a price matches my price from the spreadsheet, it returns the text name of the bank, if it doesn't match then it puts "average". I would use nested ifs except it limits 7 and I have 10 banks.

I'll try my best to show an example with 3 securities

AA BB CC DD EE FF GG HH II JJ My prices
A 3 4 3.5 3
B 2 1 1.6 2
C 5 5.5 6 5.5

What I would like to do then is to compare each price to my prices, if that price matches it takes the bank name from the header row and puts that in a cell. Any info is helpful. I'm doing this for a list alot bigger than I've shown.
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Welcome to the board!

Try:

=IF(ISNUMBER(MATCH(L2,B2:K2,0)),INDEX($B$1:$K$1,MATCH(L2,B2:K2,0)),"average")

in M2 and drag down
Book1
ABCDEFGHIJKLM
1AABBCCDDEEFFGGHHIIJJMy
2A343.53AA
3B211.62AA
4C55.5612average
Sheet1
 
Upvote 0

Forum statistics

Threads
1,224,847
Messages
6,181,327
Members
453,032
Latest member
Pauh

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