stop False from appearing

D

Dale G

I'm trying to use LOOKUP to place an employee's name in cell H4. The
employee's name in H4 is associated with a number (piece of work) in A4. The
number in A4 stays the same but 2 different employees do the same work on
separate days.
Monday & Friday are the days these different employee's do the work. I use
cell A1 to enter the day. My workbook has 2 sheets, sheet 1 is feeder, it has
the numbers & name. 2 is the sheet I use to record the work being preformed,
and the sheet I need the names to appear. I have come close, but I get False
next to the correct Name. Here is what I'm using.
=IF(A4="Monday",LOOKUP(A4,Feeder!$H$24:$I$43))&IF(A1="Friday",LOOKUP(A4,Feeder!$A$2:$C$83)).
This works except for when I enter Monday I get Jim SmithFALSE, and Friday
FALSEJohn Doe. How can I stop the FALSE from appearing
 
J

joeu2004

Here is what I'm using.
=IF(A4="Monday",LOOKUP(A4,Feeder!$H$24:$I$43))&
IF(A1="Friday",LOOKUP(A4,Fee­der!$A$2:$C$83)).
This works except for when I enter Monday I get Jim SmithFALSE,
and Friday FALSEJohn Doe. How can I stop the FALSE from appearing

That's why IF() has 3 parameters. You need to put something in the
3rd parameter, probably "" (null string). Try this:

=IF(A4="Monday", LOOKUP(A4,Feeder!$H$24:$I$43), "") &
IF(A1="Friday", LOOKUP(A4,Fee­der!$A$2:$C$83), "")


----- original posting -----
 
D

Dale G

Thank you, that's what I needed to Know, it works great. Also I notice I
made a mistake when writting my post, A1 is for Monday & or Friday.
 
J

joeu2004

PS....

=IF(A4="Monday",LOOKUP(A4,Feeder!$H$24:$I$43))
&IF(A1="Friday",LOOKUP(A4,Fee­der!$A$2:$C$83))

It just occurred to me: it seems strange that your second condition
is A1="Friday", but your second lookup is still based on A4, just like
your first lookup. Perhaps you meant to write A1 in the second
lookup. But I wonder if you meant to write A4="Friday". In that
case, perhaps the better way to write the formula is:

=IF(A4="Monday", LOOKUP(A4,Feeder!$H$24:$I$43),
IF(A4="Friday", LOOKUP(A4,Fee­der!$A$2:$C$83), ""))

It does not alter the solution to the root cause of your problem,
namely: you need to fully specify both "if-true" and "if-false"
actions.
 
D

Don Guillett

Untested but you might try.

=LOOKUP(A4,if(a1="Monday",Feeder!$H$24:$I$43,Fee­der!$A$2:$C$83)
 
J

joeu2004

Thank you, that's what I needed to Know, it works great. Also I notice I
made a mistake when writting my post, A1 is for Monday & or Friday.

You're welcome.

For the future, it is best to cut-and-paste examples to avoid such
mistakes. (Unless you are saying you had the same mistake in the
worksheet.)

If I understand you correctly, dovetailing my "PS" follow-up, you
might try the following instead:

=IF(A1="Monday", LOOKUP(A4,Feeder!$H$24:$I$43),
IF(A1="Friday", LOOKUP(A4,Fee­der!$A$2:$C$83), ""))
 
D

Dale G

When I first wrote my post, I made a typo. A1 is were I enter the day.
here's what I have and it works very well.
Monday’s off
=IF($A$1="Monday",LOOKUP(A4,Feeder!$H$24:$I$43),"")&IF($A$1="Friday",LOOKUP(A4,Feeder!$A$2:$C$83),"")
Friday’s of
=IF($A$1="Monday",LOOKUP(A7,Feeder!$A$2:$C$83),"")&IF($A$1="Friday",LOOKUP(A7,Feeder!$H$3:$I$22),"")
Thanks again,
 

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