creating a formul

G

Guest

Trying to create a formula to do the following:
Sheet 1 column A a list of personal names a1-a10

Sheet 2 has list of names a1-a10 and list of dollar amounts colums d1-d10

want to search sheet one and if any name from sheet 2 found on sheet 1 than
the corresponding dollar amount is entered.

Any help appreciated.
 
E

Earl Kiosterud

George,

In B1 of sheet 1:
=VLOOKUP(A1, 'Sheet2'!$A$1:$B$10, 2, FALSE)

Copy down with fill handle to B10.
 
J

James

You will need to use the vlookup formula. Have a look at
this in the help menu. It's quite simple, and compares to
lists to return a value.

=vlookup(a1:a10,B1:c10,2,false)

In this case, it looks up the values in cells a1 to a10
and compares them to the values in cells b1 to b10 and
returns the second value to thr right of these cells;
that is, the values in column c.

Hope that helps.
 
G

Guest

Thank you for all the help. I am experiencing one little problem. I write
the formula into cell E1 and attempt to copy down to the last cell using the
fill handle. I seems as though every second cell comes up with #N/A. Any
ideas what is causing this.

Again thank you for all the help

James said:
You will need to use the vlookup formula. Have a look at
this in the help menu. It's quite simple, and compares to
lists to return a value.

=vlookup(a1:a10,B1:c10,2,false)

In this case, it looks up the values in cells a1 to a10
and compares them to the values in cells b1 to b10 and
returns the second value to thr right of these cells;
that is, the values in column c.

Hope that helps.
 
M

Myrna Larson

This is an array formula (since the 1st argument to VLOOKUP is not a single
cell, but 10 cells). I would also change the references to absolute, i.e.

=VLOOKUP($A$1:$A$10,$B$1:$C$10,2,0)

Then, to use this, select the 10 cells, E1:E10, and enter the above formula in
E1, and press CTRL+SHIFT+ENTER to enter it as an array formula into all 10
cells.

Note that you don't enter it in the top and copy it down. That would just keep
returning the 1st result rather than all 10.


Thank you for all the help. I am experiencing one little problem. I write
the formula into cell E1 and attempt to copy down to the last cell using the
fill handle. I seems as though every second cell comes up with #N/A. Any
ideas what is causing this.

Again thank you for all the help
 
R

Ragdyer

I don't understand the advantage to using an array formula in this
particular case.

Can anyone please explain to me the difference between:

=VLOOKUP(A1,$B$1:$C$10,2,0)
(Regular <Enter> - drag down to copy)
AND
=VLOOKUP($A$1:$A$10,$B$1:$C$10,2,0)
Array entered, <C,S,E>, where you have to first pre-select the rows, and
enter the formula in the top focus cell?

Am I missing something?
 
M

Myrna Larson

I'm not sure there is any advantage. My reply was targeted at the formula he
says he found in Help, in which the first argument was not a single cell, but
A1:A10. I haven't looked at it myself. Maybe he didn't understand the example
in Help and created the formula incorrectly.
 
G

Guest

Thanks for the help. One further question.
In the formul In sheet 2 $A$1:$b$10makes reference to two adjacent columns.
If there is a column between so there is data in a and c and none in b the
result return err,the formula in this cell referes to cells that are
currently emply. How to get around this. ie" if sheet two has data in column
a and column d.

thanks

George Yorks
 
G

Guest

Thanks for the help. I know I'll fully understand the formula structure
soon. One question, at end of formula ,4,0 what in fact does the 4 make
reference to?
 
G

Guest

I've used the following formula =vlookup(b4,sheet3!$c$1:$m$31,11,0) The
correct data is transfered to the first cell in the column all other cells
receive #N/A a value is not available to the formula or function. There is
however data to be transfered.Any help appreciated
 
M

Myrna Larson

Well, Excel isn't seeing a match. For one of the formulas that you expect to
return a value, what is in column B, and what is the matching data in column C
or your table on Sheet3? Could the problem be that you have numbers in one
place and text that looks like a number (but is stored as text) in the other?
If so, they won't match, e.g. 1 doesn't match "1"
 
G

Guest

Ihave tried to copy data from USA Today report. When I past to excel
worksheet all cells are obliterated. Does this account for the data not
being recognized. If so is there anything that can be done to make this data
useable??

Thanks for all the help and information
 
E

Earl Kiosterud

George,

The 4 is the third parameter of the VLOOKUP function, and tells it to
retrieve the cell in the 4th column of the range being looked up in. Did I
say being looked up in? Oh, well. :)
 
G

Guest

I keep saying thanks, your help is outstanding. I would like to ask two
additional questions. ie: When I enter my formula into the cells of column A
in a number of cells it returns a value in a few it returns#N/A. There is
no data in those cases but with the #n?A when I try to add the columns will
not do so as it cant enter a non digit. I'm using 0 for the last number in
my formula. How best to get around this.

Also I've copied a table from USA internet. In pasting to worksheet all the
cells are obliterated and nothing is recognized by excel. The data is
however recognized in (pardon me) lotus. Is there anyway of having my
vlookup formula search 123 in place of a sheet in excel. =vlookup(a1,
sheet2!$A$1:$j$31, 10,0). Hope these questions make sense to someone
 
R

RagDyer

First question:

Replace error message with a null ( "" ), which can then be added:

=IF(ISNA(MATCH(A1,'Sheet2'!$A$1:$A$10,0)),"",VLOOKUP(A1,
'Sheet2'!$A$1:$D$10, 4, 0)
--

HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================


I keep saying thanks, your help is outstanding. I would like to ask two
additional questions. ie: When I enter my formula into the cells of column
A
in a number of cells it returns a value in a few it returns#N/A. There is
no data in those cases but with the #n?A when I try to add the columns will
not do so as it cant enter a non digit. I'm using 0 for the last number in
my formula. How best to get around this.

Also I've copied a table from USA internet. In pasting to worksheet all the
cells are obliterated and nothing is recognized by excel. The data is
however recognized in (pardon me) lotus. Is there anyway of having my
vlookup formula search 123 in place of a sheet in excel. =vlookup(a1,
sheet2!$A$1:$j$31, 10,0). Hope these questions make sense to someone
 
G

Guest

I tried using the formula below<from =IF to 4,0) and got message too many
arguments. Bottom line it does not change the #N/A to ) which will allow the
column to be added. Any other thoughts.

Thanks much
 
R

Ragdyer

I can see that I left out a parenthesis.
I tested this against your scenario in your original post, and this *does*
work:

=IF(ISNA(MATCH(A1,Sheet2!$A$1:$A$10,0)),"",VLOOKUP(A1,Sheet2!$A$1:$D$10,4,0)
)
 
G

Guest

Thank you,
Your corrected formula works well with one lasting problem. If I remove
the data that was used for the search all the results of the search are wiped
out. I tried to remove the data to use new data for new search. Can
anything be done to correct this situation???
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top