How do I lookup values in a column, then change an equation in another column from array to normal?

KuhnerMK

New Member
Joined
Aug 28, 2014
Messages
1
I have a very complex spread sheet that takes different kinds of steel (plate, wide flange, pipe, angle, etc...) and calculates the weight. Given the various types of steel I want to focus on just plate (PL) and Angle to help simplify my equation. I am not well versed in the language for VBA, but I am capable of manipulating existing code to do what I need. Below is a sample of my table:
Row/ColumnsABCDE
1TYPETHKWIDTHLENGTHWEIGHT
2PL4.511.5105.51550.53
3PL.759.25164323.12
4ANGLE.252+24435.93
5ANGLE.53+62540.83

<tbody>
</tbody>

Here are some of the details of my table:
  • E4 should equal 12.50
  • E5 should equal 31.95
  • I have C2:C5 defined as a named range as WIDTH=EVALUATE(C2:C5).
  • Other Named ranges are as follows:
    • TYPE=A2:A5
    • THK=B2:B5
    • LENGTH=D2:D5
    • WEIGHT=E2:E5
  • My simplified equation for each weight cell is as follows as an array formula:
    • {=IF(A2="","",IF(A2="PL",B2*C2*D2*.284,IF(A2="ANGLE",B2*WIDTH*C2*D2*.284,"")))}
  • I know in the above formula for weight, it would be unnecessary to use the array formula, but this equation is very simplified for the purpose of presenting my question.

Here is what I would like to solve:
  1. How can I use VBA to look for all "ANLGE" in the range A2:A5 (or named range "TYPE") and change the corresponding weight formula from array to normal?
  2. I am definitely open to alternative suggestions.

Thank you for your help in advanced.
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

Forum statistics

Threads
1,214,646
Messages
6,120,716
Members
448,985
Latest member
chocbudda

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