# Thread: Udf vlookup Thanks: 0 Likes: 0

1. ## Udf vlookup

I have a table of items that are assigned a fixed cost.
Example:
Item) Name) Price
1) Red Ruby Shirt) \$35.22
2) Blue Tuxedo) \$47.90

On a separate sheet I have a UserForm with a list box that grabs the table from the other sheet. I would like to sometimes override the fixed price aka “mark it up” for certain occasions (ex: Red Ruby Shirt needs extra stitching). But if I were to produce 1000 units of this item, in my ERP system it is set a fixed cost, I need a UDF that helps the ERP team know that I “marked the price up”

Example:
Item) Name) Price) UDF
1) Red Ruby Shirt) \$37.32) “\$2.10 higher”
2) Blue Tuxedo) \$47.90) “No markup”

2. ## Re: Udf vlookup

Why do you need a UDF? Could we use standard worksheet formulas like this?
I've done this on a single sheet but it could easily be adapted to two.

Check Mark Up

 A B C D E F G H 1 Item Name Price Item Name Price Mark Up? 2 1 Red Ruby Shirt \$35.22 1 Red Ruby Shirt \$37.32 \$2.10 higher 3 2 Blue Tuxedo \$47.90 2 Blue Tuxedo \$47.90 No markup 4 1 Red Ruby Shirt \$34.00 \$1.22 lower

Spreadsheet Formulas
 Cell Formula H2 =IF(VLOOKUP(E2,A\$2:C\$3,3,0)=G2,"No markup",TEXT(ABS(VLOOKUP(E2,A\$2:C\$3,3,0)-G2),"\$0.00")&IF(VLOOKUP(E2,A\$2:C\$3,3,0)

Excel tables to the web >> Excel Jeanie HTML 4

## User Tag List

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•