Please improve this formula.

srizki

Well-known Member
Joined
Jan 14, 2003
Messages
1,850
Office Version
  1. 365
Platform
  1. Windows
I have this mega formula, but it is just repetitive of IFS. I want to see if it can be more efficient?

=IF(OR($A14="4 NET_ INCOME ',$A14="ECCS Net Income") ,SUMIFS(PGL!K:K,PGL!$E:$E,"NET
INCOME (Excl Non-Ctrl)"),IF($A14="4_ NET INCOME_ INCL NC" ,SUMIFS(PGL!K:K,PGL!$E:$E,"NET
INCOME (Incl Non-
Ctrl)"),IF($A14="4_NI BEF SUB INCL NC",SUMIFS(PGL!K:K,PGL!$E:$E,"INCOME BEFORE SUBS
(Incl Non-Ctrl)"),IF($A14="4_NI_ BEF _TAX SUB",SUMIFS(PGL!K:K,PGL!$E:$E,"INCOME BEFORE TAX
& SUBS (Incl Non-Ctrl)"),IF($A14="41 INTRST INC",SUMIFS(PGL!K:K,PGLI$E:$E, "INTEREST
INCOME") ),IF($A14="41 NET INTRST INC" ,SUMIFS(PGL!K:K,PGLI$E:$E,"NET INTEREST
INCOME"),IF($A14="42 INTEREST _EXP",SUMIFS(PGL!K:K,PGLI$E:$E. "INTEREST
EXPENSE"),IF($A14="44 LOAN LOSS PRV",SUMIFS(PGL!K:K,PGL!$E:$E,"LOAN LOSSES
PROV/(REVERSAL)") ),IF($A14="45 NII NON INTINC",SUMIFS(PGL!K:K,PGLI$E :$E "NON-INT
INCOME"),IF($A14="5 NON INTR EXP",SUMIFS(PGL!K:K,PGL!$E:$E, "NON-INTEREST
EXPENSE"),IF($A14="7 INCOME_ _TAX",SUMIFS(PGL!K:K,PGL!$E:$E "INCOME
TAX"),IF($A14="70 INCOME SUBS" ,SUMIFS(PGL!K:K,PGL!$E:$E, "INCOME FROM
SUBS"),IF($C14<>"" ,SUMIFS(PGL!K:K,PGL!$F:$E!Compare (Rollup)'!$C14),SUMPRODUCT(--
(CONCATENATE("%,N",$A14)=PGL!$A$17.$A$ 1000),PGL!K$17:K$ 1000)+SUMPRODUCT(--
(CONCATENATE("%,R," ,$A14)=PGL !.$A$17:$A$1000),PGL!K$17:K$ 1O0O))))))))))))))

Best Regards
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Please provide some data. 15 to 20 rows. Use XL2BB or a sharted link.
 
Upvote 0
I can not provide the data, it is on my work computer, but the formula says it all, =IF(SUMIFS, and SUMPRODUCT formula.
 
Upvote 0
You really need to help us help you. As shift-del mentioned your formula is invalid. Did you use an ink to text converter on it or something, the errors look like typo's but you can't possibly have typed that all in eg: PGL!K$17:K$ 1O0O (the letter O where it should be 0)

I suggest you start with throwing a lookup table into the mix to convert what you have in A14 into the value you need for the SumIfs column E evaluation.
That should reduce the whole formula to a single SumIfs and your catch all SumProduct formula at the end.
I would recommend making the mapping table an Excel Table to minimise future maintenance.

20240517 Nested If with Mapping Table srizki.xlsx
ABCDE
11Lookup Table to Convert A14 value to Data Table values
12
13Category to SumSumIfsA14 ValueFull Description
144_ NET INCOME_ INCL NC3,030ECCS Net IncomeNETINCOME (Excl Non-Ctrl)
154_ NET INCOME_ INCL NCNETINCOME (Incl Non-Ctrl)
164_NI BEF SUB INCL NCINCOME BEFORE SUBS(Incl Non-Ctrl)
174_NI_ BEF _TAX SUBINCOME BEFORE TAX& SUBS (Incl Non-Ctrl)
18
19
Main
Cell Formulas
RangeFormula
B14B14=SUMIFS(PGL!K:K,PGL!E:E,VLOOKUP($A14,$D$14:$E$17,2,FALSE))
 
Upvote 0

Forum statistics

Threads
1,217,394
Messages
6,136,334
Members
450,005
Latest member
BigPaws

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