Nested IF driving me nuts...

J

John Croson

I have a workbook with a few sheets in it.

One has master data:
Status Item # Description
Film Former Pkg Lot Code format
A 00121 My item
00131 - XYZXYZ

Many lines of data. I have another sheet that users are instructed to
enter the item number ( In Cell B1), and it populates a cell below
with VLOOKUP data. There are a number of cells that do this.

This formula displays the Description.

=IF($B1<>"",VLOOKUP($B1,MasterInfo!$C$3:$D$228,2,FALSE),"")

The conundrum is the Status field. What we'd like to do is:
1. Check if a number entered in B1 matches one in the MasterInfo
sheet.
2. If it does, display the description IF the Status is A. If the
status is I, display "Inactive Profile". If the Status is P, display
"Pending Profile".

Anyone that could assist me is greatly appreciated.
 
P

Pete_UK

Try this:

=IF($B1<>"",IF(ISNA(MATCH($B1,MasterInfo!$C:$C,0)),"",IF(INDEX
(MasterInfo!$A:$A,MATCH($B1,MasterInfo!$C:$C,0))="I","Inactive
Profile",IF(INDEX(MasterInfo!$A:$A,MATCH($B1,MasterInfo!$C:$C,0))
="P","Pending Profile",VLOOKUP($B1,MasterInfo!$C$3:$D$228,2,0)))))

It doesn't test specifically for a status of A - I've assumed that the
status can only be I, P or A.

Hope this helps.

Pete
 
J

John Croson

Try this:

=IF($B1<>"",IF(ISNA(MATCH($B1,MasterInfo!$C:$C,0)),"",IF(INDEX
(MasterInfo!$A:$A,MATCH($B1,MasterInfo!$C:$C,0))="I","Inactive
Profile",IF(INDEX(MasterInfo!$A:$A,MATCH($B1,MasterInfo!$C:$C,0))
="P","Pending Profile",VLOOKUP($B1,MasterInfo!$C$3:$D$228,2,0)))))

It doesn't test specifically for a status of A - I've assumed that the
status can only be I, P or A.

Hope this helps.

Pete

Thanks for trying this, but it still only prints the description,
regardless of the status. I'll try mucking about with it today.
 
P

Pete_UK

Just check that you do not have any space characters in there along
with the status letter. Use =LEN( ) to find out how many characters
you have in the status cells.

Hope this helps.

Pete
 
J

John Croson

Just check that you do not have any space characters in there along
with the status letter. Use =LEN( ) to find out how many characters
you have in the status cells.

Hope this helps.

Pete

Thanks, but no change. LEN = 1.

Any other ideas?
 
J

John Croson

Just check that you do not have any space characters in there along
with the status letter. Use =LEN( ) to find out how many characters
you have in the status cells.

Hope this helps.

Pete

IT WORKED. I just screwed something up prior to my last post.

THANKS FOR THE HELP!!!!!!!
 

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