how do I insert a cell based on its match with an adjacent cell?

G

Gabbon

Hi,
There's got to be a way to do this (mail merge style perhaps...)
I would like to insert the entry/ies under a heading in a table in one
worksheet whenever that heading matches the data entered in a separate
worksheet.
Presently I can find no way to do this in Excel.
Please can you suggest a way to do this...
Thanks
G
 
B

Biff

Need a better more detailed explanation.

The more details you provide, the easier it is to find a solution!

Biff
 
G

Gabbon

Hi,
Thanks for your reply.
I have a table with three headings (could be more soon), and a sub-entry
under each heading.
I also have a row in which those headings appear occasionally. I am looking
for a way to enter the sub-entry of those headings in the row underneath at
every point at which those three headings appear.
(This is pretty much the style of the Word mail merge operation).
Can you point me in the right direction? Or any direction--I have looked
through help and can't locate where to find the answer
Thanks,
Gabbon
 
D

daddylonglegs

If your headings are in A1:C1 and sub-headings in A2:C2

If you want the appropriate sub-heading to appear in E11, for instance,
when you put one of the headings in E10 then one way would be to use
this formula in E11

=HLOOKUP(E10,$A$1:$C$2,2,0)

You can copy this formula along the row
 
G

Gabbon

Perfect!
Thank you very much--I appreciate it
(I still need to find a way to have the cell appear blank when the sub-entry
data is blank. Entering a space does the trick, but I'm sure there is
another formula to use to return a blank cell rather than a cell with 0 in it)
Gabon
 
G

Gabbon

I've come across another problem.
I'm trying to match the heading to a date! :-(
And I only wish to match it with the day and month, but not the year.
Is there any way to match with the month and day, and exclude the year for
the calculation?
I do very much appreciate the help,
Gabbon
 
P

Peo Sjoblom

I think we need some more info, what are the contents of the headers and
what is the content of the lookup cell?

--
Regards,

Peo Sjoblom

Portland, Oregon
 
D

daddylonglegs

Based on my previous example perhaps

=HLOOKUP(TEXT(E10,"dd-mm"),TEXT($A$1:$C$2,"dd-mm"),2,0)

conformed with CTRL+SHIFT+ENTER
 
V

vezerid

Gabbon,
I would say you need a table of 4 columns: First column a date and the
remaining three ones your current headings.
It seems to me you want is to select a date, and then to report the
value of the three sub-headings for the row of this date.

If I have understood you correctly, then the following formula will do:

=IF(VLOOKUP(date, $A:$D, MATCH(heading,
$A$1:$D$1,0))="","",VLOOKUP(date, $A:$D, MATCH(heading, $A$1:$D$1,0)))

Supply cell references for date and heading.

HTH
Kostis Vezerides
 
G

Gabbon

Thank you so very much (how do you find this stuff--I looked all over help
and could not locate it)
The formula:
=HLOOKUP(TEXT(E10,"dd-mm"),TEXT($A$1:$C$2,"dd-mm"),2,0)
confirmed with CTRL+SHIFT+ENTER

Was perfect, and does as I sought (brilliant!)
Thanks again
 
G

Gabbon

Peo Sjoblom said:
=IF(formula="","",formula)

@Peo Sjoblom
I'm not sure what you mean... The cell result I wish to avoid is the #N/A.

If E11 has the result value #N/A, and I enter the formula:
=IF(E11="","",E11) in cell E12

All I (still) get is #N/A

Is there a way to avoid the #N/A result?
 
G

Gabbon

Peo Sjoblom said:
=IF(formula="","",formula)

Not quite:
if(formula="","",formula) only returns the #N/A value.

What you need is the additional use of the isna function, which will return
a usable value (TRUE, or FALSE) based on the presence, or otherwise of the
#N/A value.

The following will return a blank cell if the value in cell_ref is #N/A:

=IF(ISNA(cell_ref)=TRUE,"",(cell_ref))
 
Top