MS Excel Help

Moderator: Baseball Moderators

MS Excel Help

I am having problems with IF THEN statements in excel and need some expert help.

I'd like to search a a particular column for a specific item, then if the item matches a cell from the worksheet, input a number from a corresponding row to that column from the second worksheet.

Let me provide an example.

I have two worksheets in the file, Projection and 2008 #s. Each worksheet has the same titles to first columns, Name, PA, HR. The worksheet 2008 #s has the following info in rows 2, 3, and 4: Sizemore, 700, 30 // Braun, 600, 40 // Pujols, 625, 45. In the Projection worksheet, cell a2, I have the info Braun. In cell b2, I would like a formula to search all of the column Name in worksheet 2008 #s, and if it matches cell a2, input the corresponding info from the PA column in the 2008 #s worksheet into cell b2.

Here's the formula I currently have (which doesn't work):

=if(A2='2008 #s'!A:A,'2008 #s'!B1:B170,0)

There is a problem with the middle item, the "value if true" part of the formula, and I have no idea how to fix it. Any help would be greatly appreciated.

PS - I probably insane for doing this in excel and not access, but I have no idea how to use access.
In my fridge: Founders Kentucky Breakfast Stout (KBS), Central Waters Peruvian Morning, Bell's Batch 10,000, Dale's Pale Ale, Capital Brewery Amber, New Glarus Moon Man, and Guinness.
Steve-o
Major League Manager

Posts: 1879
Joined: 7 May 2004
Home Cafe: Baseball
Location: Finally back home. A sweet 15 mi from Miller Park.

Re: MS Excel Help

Steve,

There are a number of ways to do this. You can also look at CHOOSE and INDEX/MATCH. But in your scenario VLOOKUP is the simplest:

=VLOOKUP(A2,'2008 #s'!A2:C4,2)

A2:C4 - The range being searched. Must be expanded if your table expands.
2 - The column of the data you're retrieving. In this case PA.
Maine has a good swing for a pitcher but on anything that moves, he has no chance. And if it's a fastball, it has to be up in the zone. Basically, the pitcher has to hit his bat. - Mike Pelfrey
Amazinz
Mod in Retirement

Posts: 18800
Joined: 16 Mar 2004
Home Cafe: Baseball
Location: in Canada, toughening up figure skaters

Re: MS Excel Help

Thanks a million.

=VLOOKUP(A2,'2008 #s'!A2:C4,2,false)

to get an exact name match, but you pointed me in the right direction.
In my fridge: Founders Kentucky Breakfast Stout (KBS), Central Waters Peruvian Morning, Bell's Batch 10,000, Dale's Pale Ale, Capital Brewery Amber, New Glarus Moon Man, and Guinness.
Steve-o
Major League Manager

Posts: 1879
Joined: 7 May 2004
Home Cafe: Baseball
Location: Finally back home. A sweet 15 mi from Miller Park.