Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 258
Default Problem with IF statement

In the formula below if J7 is blank the result should be a blank cell, but
it is returning #N/A because the VLOOKUP is finding a blank cell when it
does it's lookup. Why is it performing the VLOOKUP and displaying #N/A when
the IF statement is False?

=IF(J70,IF(AC8=0,VLOOKUP(J7,'[Work
Shifts.xls]Sunday'!$D$2:$K$100,8,0),AC8),"")


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 48
Default Problem with IF statement

Patrick,

Try

=If(J7="",IF(AC8=0,VLOOKUP(J7,'[Work
Shifts.xls]Sunday'!$D$2:$K$100,8,0),AC8),"")
"Patrick Simonds" wrote in message
...
In the formula below if J7 is blank the result should be a blank cell, but
it is returning #N/A because the VLOOKUP is finding a blank cell when it
does it's lookup. Why is it performing the VLOOKUP and displaying #N/A
when the IF statement is False?

=IF(J70,IF(AC8=0,VLOOKUP(J7,'[Work
Shifts.xls]Sunday'!$D$2:$K$100,8,0),AC8),"")



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 258
Default Problem with IF statement

This makes no difference

"Charles Harmon" wrote in message
...
Patrick,

Try

=If(J7="",IF(AC8=0,VLOOKUP(J7,'[Work
Shifts.xls]Sunday'!$D$2:$K$100,8,0),AC8),"")
"Patrick Simonds" wrote in message
...
In the formula below if J7 is blank the result should be a blank cell,
but it is returning #N/A because the VLOOKUP is finding a blank cell when
it does it's lookup. Why is it performing the VLOOKUP and displaying #N/A
when the IF statement is False?

=IF(J70,IF(AC8=0,VLOOKUP(J7,'[Work
Shifts.xls]Sunday'!$D$2:$K$100,8,0),AC8),"")





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default Problem with IF statement

VLOOKUP will return #N/A when it doesn't find a match

If you want a blank shown instead of #N/A then you need to do something like
=IF(ISNA(VLOOKUP(J7,'[Work Shifts.xls]Sunday'!$D$2:$K$100,8,0)), "",
VLOOKUP(J7,'[Work Shifts.xls]Sunday'!$D$2:$K$100,8,0))

I wish there was a REPLACENA function, but there isn't

--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Patrick Simonds" wrote in message
...
This makes no difference

"Charles Harmon" wrote in message
...
Patrick,

Try

=If(J7="",IF(AC8=0,VLOOKUP(J7,'[Work
Shifts.xls]Sunday'!$D$2:$K$100,8,0),AC8),"")
"Patrick Simonds" wrote in message
...
In the formula below if J7 is blank the result should be a blank cell,
but it is returning #N/A because the VLOOKUP is finding a blank cell
when it does it's lookup. Why is it performing the VLOOKUP and
displaying #N/A when the IF statement is False?

=IF(J70,IF(AC8=0,VLOOKUP(J7,'[Work
Shifts.xls]Sunday'!$D$2:$K$100,8,0),AC8),"")







  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 258
Default Problem with IF statement

But in this case the IF Statement returns a false and the VLOOKUP result
should not be displayed. The false result should be a blank ("") cell


"Rob van Gelder" wrote in message
...
VLOOKUP will return #N/A when it doesn't find a match

If you want a blank shown instead of #N/A then you need to do something
like
=IF(ISNA(VLOOKUP(J7,'[Work Shifts.xls]Sunday'!$D$2:$K$100,8,0)), "",
VLOOKUP(J7,'[Work Shifts.xls]Sunday'!$D$2:$K$100,8,0))

I wish there was a REPLACENA function, but there isn't

--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Patrick Simonds" wrote in message
...
This makes no difference

"Charles Harmon" wrote in message
...
Patrick,

Try

=If(J7="",IF(AC8=0,VLOOKUP(J7,'[Work
Shifts.xls]Sunday'!$D$2:$K$100,8,0),AC8),"")
"Patrick Simonds" wrote in message
...
In the formula below if J7 is blank the result should be a blank cell,
but it is returning #N/A because the VLOOKUP is finding a blank cell
when it does it's lookup. Why is it performing the VLOOKUP and
displaying #N/A when the IF statement is False?

=IF(J70,IF(AC8=0,VLOOKUP(J7,'[Work
Shifts.xls]Sunday'!$D$2:$K$100,8,0),AC8),"")











  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default Problem with IF statement

Check that J7 is not blank
Check that AC8 is not 0 (or blank)

--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Patrick Simonds" wrote in message
...
But in this case the IF Statement returns a false and the VLOOKUP result
should not be displayed. The false result should be a blank ("") cell


"Rob van Gelder" wrote in message
...
VLOOKUP will return #N/A when it doesn't find a match

If you want a blank shown instead of #N/A then you need to do something
like
=IF(ISNA(VLOOKUP(J7,'[Work Shifts.xls]Sunday'!$D$2:$K$100,8,0)), "",
VLOOKUP(J7,'[Work Shifts.xls]Sunday'!$D$2:$K$100,8,0))

I wish there was a REPLACENA function, but there isn't

--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Patrick Simonds" wrote in message
...
This makes no difference

"Charles Harmon" wrote in message
...
Patrick,

Try

=If(J7="",IF(AC8=0,VLOOKUP(J7,'[Work
Shifts.xls]Sunday'!$D$2:$K$100,8,0),AC8),"")
"Patrick Simonds" wrote in message
...
In the formula below if J7 is blank the result should be a blank cell,
but it is returning #N/A because the VLOOKUP is finding a blank cell
when it does it's lookup. Why is it performing the VLOOKUP and
displaying #N/A when the IF statement is False?

=IF(J70,IF(AC8=0,VLOOKUP(J7,'[Work
Shifts.xls]Sunday'!$D$2:$K$100,8,0),AC8),"")











Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
IF Statement Problem SixBowls Excel Discussion (Misc queries) 4 December 11th 09 05:33 PM
IF Statement problem MarkFrost39 Excel Worksheet Functions 0 September 6th 07 02:50 PM
IF Statement problem MarkFrost39 Excel Worksheet Functions 0 September 6th 07 02:50 PM
IF STATEMENT PROBLEM Manjit Gosal Excel Worksheet Functions 4 November 10th 05 05:40 PM
IF Statement problem trixma New Users to Excel 3 September 27th 05 06:36 AM


All times are GMT +1. The time now is 01:58 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"