VBA Function query

KeelySG

New Member
Joined
Feb 25, 2019
Messages
5
Hi folks

I'm trying to create a VBA function which generates quite a complex formula if there's a particular value in Cell G25. Can anyone help please?

My formula is:
=IF(G25="46mm",INDEX(Matrix!A:K,AGGREGATE(15,3,((Matrix!$B$6:$B$13>=M25)/(Matrix!$B$6:$B$13>=M25))*ROW(Matrix!$B$6:$B$13),1),AGGREGATE(15,3,((Matrix!$C$5:$G$5>=I25)/(Matrix!$C$5:$G$5>=I25))*COLUMN(Matrix!$C$5:$G$5),1)),IF(G25="67mm",INDEX(Matrix!A:K,AGGREGATE(15,3,((Matrix!$B$6:$B$13>=M25)/(Matrix!$B$6:$B$13>=M25))*ROW(Matrix!$B$6:$B$13),1),AGGREGATE(15,3,((Matrix!$C$5:$K$5>=I25)/(Matrix!$C$5:$K$5>=I25))*COLUMN(Matrix!$C$5:$K$5),1)),IF(G25="90mm",INDEX(Matrix!A:K,AGGREGATE(15,3,((Matrix!$B$6:$B$13>=M25)/(Matrix!$B$6:$B$13>=M25))*ROW(Matrix!$B$6:$B$13),1),AGGREGATE(15,3,((Matrix!$C$5:$G$5>=I25)/(Matrix!$C$5:$G$5>=I25))*COLUMN(Matrix!$C$5:$G$5),1)))))+AL25

I'm currently using the above formula in Cell AG25 but it's generating a #VALUE! error where there's no content in cell G25.
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
What is in AL25 ?
What is the result if you remove +AL25 ?
And what is the result if you put +AL25 inside the IF brackets? (move the last bracket after AL25)
 
Upvote 0
In this cell there's a formula which is dependent on others in the row, that returns another value (currency). If I put this inside the brackets, it doesn't return a value.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,325
Members
452,635
Latest member
laura12345

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