Is it possible to insert unique formulas into cells based on a product code?

tarallox

New Member
Joined
May 23, 2015
Messages
7
Hi everyone,I do have a complicated problem to solve and I was wondering if anyone can point me to the right direction as to how to tackle this problem.So I've got 5 product codes, and I've formulated 5 different unique excel formula codes for each product. For example,Product 1codes to calculate the position is =if( I$I$>$D$D, "BUY", "SELL").Product 2 codes: = IF ($I$I>$C$C, "DECISION", IF ($I$I>$G$G, "SELL", IF ("$T$T<$Z$Z, "NO","-"). Products 3 Codes = IF ($T$T>$G$G, "POINT", IF ($G$G=$A$A, "MAYBE","-")
Product 4 and 5's codes are equally unique and different. As you can see, it's very unique codes and contains nested IFs etc. Now I've been copying and pasting these individual codes into separate spreadsheets based on the product (i.e. if it's product 1, I'll paste product 1's code into the cell). I've actually done up a LOOKUP table in the hopes of using VLOOKUP to paste the codes according to the product column. e.g. PRODUCT /// CODE TO PASTE This is not possible with the usual =VLOOKUP excel formulas however, I was wondering if this is possible with VLOOKUP VBA? Or do you think I should use multiple nested IFs then on VBA? i.e. If COLUMN M is "product 1", calculate in COLUMN N with this formula "=if( I$I$>$D$D, "BUY", "SELL")."? Sorry for the long message, I'm at my wits end at solving this and hope someone will be able to help - thank you for your time!!
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
restate it much more simply

eg I have 2 product codes prod1 and prod2 in column 1. In column 2 I wish to determine actions that are different according to which code is in col 1.

if the code is prod1 I want to look at the values in col 3 and col4 and make a certain decision. However if the code is prod2 I want to look at col3 col5 and col6.
 
Upvote 0
Thanks Oldbrewer! My question is tho - is it possible to automatically add in a formula into the cell via VBA or no?
 
Upvote 0
yes - put a master copy of the formula in a spare cell and use a macro to copy THAT formula into your desired cell.........
 
Upvote 0

Forum statistics

Threads
1,213,532
Messages
6,114,177
Members
448,554
Latest member
Gleisner2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top