small excel question

stevejh123

New Member
Joined
Mar 3, 2005
Messages
5
I need help with a small formula.

What I need to know is how would I take the value of cell (B) if the value in cell (A) = what i tell it.

Like

if a cell in coloum a = mike then give me the number beside it in coloum B
So what I would need is if coloum A1:A100= mike then give me the number beside mike in coloum B that would be 5

A B
1 mike 5
2 bob 2
3 jim 3
4
5

Thanks

Steve
 

Some videos you may like

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.

saranat

New Member
Joined
Jan 26, 2005
Messages
15
have you tried the VLOOKUP formula?
vlookup(A1,A1:B10,2)
This gives the value in cell Bx that corresponds to Ax
saranat
 

BuddieB

Board Regular
Joined
Aug 6, 2003
Messages
174
There are a number of ways you can do this but most depend on how many variations you are going to have, if you only have a couple of variaitions the easiest way is to use an IF statement:

put this formula in B1
=IF(A1="MIKE",7)

if you want to put a 7 in column B anytime column A has the value MIKE
 

Joe Was

MrExcel MVP
Joined
Feb 19, 2002
Messages
7,539
In any cell that is not "A or B" put:
=IF(A1="Mike",B1,"")
 

Scott Huish

MrExcel MVP
Joined
Mar 17, 2004
Messages
19,958
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
Are there one or many matches?

If you want the sum of all the matches:

=SUMIF(A1:A100,"mike",B1:B100)

If you want the number from the first match, perhaps:

=VLOOKUP("mike",A1:B100,2,0)
 

Watch MrExcel Video

Forum statistics

Threads
1,122,469
Messages
5,596,321
Members
414,053
Latest member
Dual Showman

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
Top