Hi Everybody,

I'm wondering if someone would please help me with the below query. I think it's pretty simple but I'm not too excel savy.

Basically I'm referencing a worksheet called "Orders" with product codes like "THB001" for instance. I'm trying to get them to automatically reference on an invoice worksheet in a cell. However, I would like them to automatically reference underneath each other too. So if the first cell equals "THB001" for example, I want the one underneath to either equal nothing or not the same code already mentioned on the line above or a different code. I want this to continue for a range for 7 different cells underneath each other.

The spreadsheet works by entering data in orders and I'd like them to automatically appear on an invoice worksheet.

Here is the code I have for the invoice worksheet and the second invoice line. Please note the first invoice line is everything but the first if or statement mentioned in the code below.


=-IF(OR(D19="PBA001",D19="MTA001",D19="TKT001",D19="THB001"),"",IF(Orders!D$17>0,"THB001",IF(AND(Orders!D$17=0,Orders!D$18>0),"MTA001",IF(AND(Orders!D$17=0,Orders!D$18=0,Orders!D$19>0),"TKT001",IF(AND(Orders!D$17=0,Orders!D$18=0,Orders!D$19=0,Orders!D$20>0),"PBA001")))))

I'm just wondering if there is a way I can select a range instead of doing each of "D19" for example individually. For instance if this code is mentioned, don't reenter anything but if another code needs to be entered please reenter without duplicating. Sorry D19 refers to the first invoice line. I'm not sure how to select the range. I tried D19:D20 but that it didn't really work. It just kept coming up with a value message.

I know this is a strange query but any help would be greatly appreciated. Thank you for your time.

Kind regards,

BTB[/SIZE]