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.
 

Some videos you may like

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple

bobsan42

Well-known Member
Joined
Jul 14, 2010
Messages
1,343
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)
 

KeelySG

New Member
Joined
Feb 25, 2019
Messages
5
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.
 

Watch MrExcel Video

Forum statistics

Threads
1,108,509
Messages
5,523,313
Members
409,511
Latest member
hitesh222002

This Week's Hot Topics

Top