Need help shortening formula

mrblister

Board Regular
Joined
Nov 20, 2016
Messages
191
Office Version
  1. 2019
Platform
  1. Windows
=C5+(IF(INDEX(ColumnD, 1)="apples",IF($B3<index(table1, match("fertilizernumber",="" table1rownames,0),="" match(index(columna,="" 1)&"apples",="" table1headers,0)),vlookup($b3,table2,match(index(columna,="" 1)&"apples",table2headers,0),true),seriessum($b3,1,1,indirect(vlookup(index(columna,="" 1),table3,match("coefs",table3headers,0))))),0)*lookup(index(columna,="" 1),$a$2:$z$2,$a5:$z5))+<="" td=""></index(table1,>
(IF(INDEX(ColumnD, 2)="apples",IF($B3<index(table1, match("fertilizernumber",="" table1rownames,0),="" match(index(columna,="" 2)&"apples",="" table1headers,0)),vlookup($b3,table2,match(index(columna,="" 2)&"apples",table2headers,0),true),seriessum($b3,1,1,indirect(vlookup(index(columna,="" 2),table3,match("coefs",table3headers,0))))),0)*lookup(index(columna,="" 2),$a$2:$z$2,$a5:$z5))+...<="" td=""></index(table1,>
(IF(INDEX(ColumnD, n)="apples",IF($B3<index(table1, match("fertilizernumber",="" table1rownames,0),="" match(index(columna,="" n)&"apples",="" table1headers,0)),vlookup($b3,table2,match(index(columna,="" n)&"apples",table2headers,0),true),seriessum($b3,1,1,indirect(vlookup(index(columna,="" n),table3,match("coefs",table3headers,0))))),0)*lookup(index(columna,="" n),$a$2:$z$2,$a5:$z5))<="" td=""></index(table1,>

<tbody>
</tbody>

EDITING!!! I DON'T KNOW WHY, BUT IT WON'T DISPLAY THE WHOLE FORMULA!

n = number of entries in ColumnD (the same number of entries in columnA)

The above formula is located in C6, copied down. It checks the each item (fruit type) in ColumnD, and if it matches "apples", the rest of the function is computed. If ColumnD is a match, the value of ColumnA (on the same row as ColumnD) is returned (like a left-lookup) as the identifier (fruit name e.g. "RoyalGala") used in the rest of the formula, as the ID used to searched for in the other tables. If it matches certain criteria, look up the output on Table2, otherwise compute the output using a formula.
Then after all the results are summed up, then add the previous amount from the cell above.

Any ideas on ways to shorten this? It works, but is super-long. I tried converting it to array and sumproduct but I must've made a mistake somewhere.
 
Last edited:
Have you tried doing an index match with multiple criteria? Also, you might be able to might be able to use "Name Manger" to reduce some of the longer names.
 
Upvote 0

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN

Forum statistics

Threads
1,214,985
Messages
6,122,605
Members
449,089
Latest member
Motoracer88

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