Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 20
Default VLOOKUP text vs number issues returning value

Hi All,
I'm having two problems with the formula in column I of the "RAW DATA" worksheet attached.

1. THe first argument looks if adjacent cell has value "NO PART"...if so, it leaves the cell blank. I also want to add an "OR" to this that if the cell is blank, or has "NO PART", to leave cell blank. How do I add the *OR?

2. When the above is false, the look up function seems to be having a problem. It is looking for the value but not finding it. It also seems to give two error codes...#NA and #REF!. This seems to matter if the value being looked up is a number or a number stored as text. Any ideas?
Attached Files
File Type: zip PLV IQA-IBQ_test.zip (66.3 KB, 168 views)
  #2   Report Post  
Junior Member
 
Posts: 1
Default

Quote:
Originally Posted by puck1263 View Post
Hi All,
I'm having two problems with the formula in column I of the "RAW DATA" worksheet attached.

1. THe first argument looks if adjacent cell has value "NO PART"...if so, it leaves the cell blank. I also want to add an "OR" to this that if the cell is blank, or has "NO PART", to leave cell blank. How do I add the *OR?

2. When the above is false, the look up function seems to be having a problem. It is looking for the value but not finding it. It also seems to give two error codes...#NA and #REF!. This seems to matter if the value being looked up is a number or a number stored as text. Any ideas?
Take a look at the VLOOKUP portion of your formula:

=IF(H3="NO PART","",VLOOKUP(H3,'Equipment List'!$C$1:$C$4138,13,FALSE))

You are looking up whatever is in H3.

The table_array, which is where Excel is looking for both whatever is in H3 and whatever you want the VLOOKUP to return, is only one column. That's a problem! You need the table_array to include a column for what you are looking for (the Top Level Tool #) and what you want to return in column I.

Then you are telling Excel to look at the 13th column of the table_array, even though there is only one.

None of your VLOOKUPs are working, and I'd fix that before turning to IF(NOT).
  #3   Report Post  
Senior Member
 
Posts: 663
Default

Quote:
Originally Posted by puck1263 View Post
Hi All,
I'm having two problems with the formula in column I of the "RAW DATA" worksheet attached.

1. THe first argument looks if adjacent cell has value "NO PART"...if so, it leaves the cell blank. I also want to add an "OR" to this that if the cell is blank, or has "NO PART", to leave cell blank. How do I add the *OR?

2. When the above is false, the look up function seems to be having a problem. It is looking for the value but not finding it. It also seems to give two error codes...#NA and #REF!. This seems to matter if the value being looked up is a number or a number stored as text. Any ideas?
Hi Puck,

1) Change the formula in I3 on the Raw Data tab to the one below and copy down.
=IF(OR(H3="NO PART",H3=""),"",VLOOKUP(H3,'Equipment List'!$C$1:$O$4138,13,FALSE))

I've added in your required OR statement and also corrected the VLOOKUP range (you were looking only in column C rather than from C-O)

You also need to amend some of the "blank" cells in column H as they are not actually blank but rather contain spaces.

Hope that helps.

S.
  #4   Report Post  
Junior Member
 
Posts: 20
Default

Thanks. Look ups are working now. I didn't realize about including the whole array.

What would be a better way to handle the "blanks" (or "" as it is now) in column H?

When I put the formula above in I3, it is returning a value, even though H3 is truly blank. I don't know what it's looking up. Any ideas?

Last edited by puck1263 : June 21st 12 at 10:34 PM
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 829
Default VLOOKUP text vs number issues returning value

"puck1263" wrote:
I'm having two problems with the formula in column I of the
"RAW DATA" worksheet attached.

[....]
|Download: http://www.excelbanter.com/attachment.php?attachmentid=432|

[....]
1. THe first argument looks if adjacent cell has value
"NO PART"...if so, it leaves the cell blank. I also want
to add an "OR" to this that if the cell is blank, or has
"NO PART", to leave cell blank. How do I add the *OR?


Ostensibly:

=IF(OR(H3="",H3="NO PART"),"",...)

However, some of the cells in column H that appear blank actually contain
one or more spaces.

Ideally, I would suggest that you find out why and try to avoid that.

Alternatively, the following seems to work with your data:

=IF(OR(TRIM(H3)="",H3="NO PART"),"",...)


"puck1263" wrote:
2. When the above is false, the look up function seems
to be having a problem. It is looking for the value but
not finding it. It also seems to give two error codes...
#NA and #REF!. This seems to matter if the value being
looked up is a number or a number stored as text. Any
ideas?


The #REF errors are because you reference column 13 of the lookup table, but
the lookup table has only one column. Change $C$1:$C$4138 to $C$1:$O$4138,
to wit:

VLOOKUP(H3,'Equipment List'!$C$1:$O$4138,13,FALSE)

The OR(TRIM(H3)="",...) logic above will remove some #N/A errors as well as
some bogus results.

The remaining #N/A errors arise because the equipment number in column H
does not appear in column A of worksheet "Equipment List".

Correct that either by fixing the equipment numbers in column H or by adding
equipment numbers to that table in "Equipment List".

Alternatively, since you are using Excel 2007 or later (xlsx file), you can
do the following if you do not require Excel 2003 compatibility:

=IFERROR(IF(OR(TRIM(H3)="",H3="NO PART"),"",
VLOOKUP(H3,'Equipment List'!$C$1:$O$4138,13,FALSE)),"")

If you do require Excel 2003 compatibility, you will need to do the
following:

=IF(OR(TRIM(H3)="",H3="NO PART"),"",
IF(ISNUMBER(MATCH(H3,'Equipment List'!$C$1:$C$4138,0)),
VLOOKUP(H3,'Equipment List'!$C$1:$O$4138,13,FALSE),""))



  #6   Report Post  
Junior Member
 
Posts: 20
Default

Ok. I think I got the above sorted out, but I'm still having a similar issue.
See FTC OBQ-PA attached.

On the "tools in PA" worksheet, columns F, G and H are returning #NA. I don't get it.
(Some won't appear because I had to cut the size of the source list to attach to this site, but most are still there.)
Attached Files
File Type: zip FTC OBQ-PA.zip (96.3 KB, 73 views)
  #7   Report Post  
Senior Member
 
Posts: 663
Default

Quote:
Originally Posted by puck1263 View Post
Ok. I think I got the above sorted out, but I'm still having a similar issue.
See FTC OBQ-PA attached.

On the "tools in PA" worksheet, columns F, G and H are returning #NA. I don't get it.
(Some won't appear because I had to cut the size of the source list to attach to this site, but most are still there.)
Hi,

Did you attach the right example? I don't see a "tools in PA" worksheet....
  #8   Report Post  
Junior Member
 
Posts: 20
Default

Quote:
Originally Posted by Spencer101 View Post
Hi,

Did you attach the right example? I don't see a "tools in PA" worksheet....
Sorry, its "No of Tools in PA Pivot"
  #9   Report Post  
Senior Member
 
Posts: 663
Default

Quote:
Originally Posted by puck1263 View Post
Sorry, its "No of Tools in PA Pivot"
Format Column A on the "Equipment List" sheet as numbers and all should work out well. It did for me anyway...
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
VLOOKUP - Not returning the proper number (Caro) Caroline Excel Worksheet Functions 1 February 25th 10 03:43 PM
Number and Text issues Shane Excel Programming 1 February 23rd 10 08:40 AM
Number and Text issues dan dungan Excel Programming 0 February 19th 10 07:45 PM
Number/Text Issues Shane Excel Programming 1 January 11th 10 08:08 PM
Access Excel Linked Text and Number Issues Scott Excel Discussion (Misc queries) 2 October 4th 05 09:24 PM


All times are GMT +1. The time now is 09:57 AM.

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

About Us

"It's about Microsoft Excel"