More Robust Formula

Peggy2015

Board Regular
Joined
Oct 19, 2015
Messages
109
Hello,

We have a spreadsheet that is referencing data based on the criteria if it says 'Flat Cash' or 'Projects':

P5BIS Facilities
FINANCIAL FORECASTING 2016/17
Analysis by Flat Cash / ProjectActualActualForecastForecastForecastForecastForecastForecastForecastForecastForecastForecast
Net Expenditure123456789101112
Flat Cash35,38834,76834,39534,39534,39534,39540,94434,39334,39634,39734,39734,397
Projects000000000000
Net Expenditure35,38834,76834,39534,39534,39534,39540,94434,39334,39634,39734,39734,397

<tbody>
</tbody><colgroup><col><col><col span="12"></colgroup>


This is the formula in the cell C5 for the value: 35,388:

=IF(VLOOKUP($A$35,'INPUT DATA'!$D$39:$E$46,2,FALSE)=Analysis!$B51,Analysis!C$35,0)+IF(VLOOKUP($A$36,'INPUT DATA'!$D$39:$E$46,2,FALSE)=Analysis!$B51,Analysis!C$36,0)+IF(VLOOKUP($A$37,'INPUT DATA'!$D$39:$E$46,2,FALSE)=Analysis!$B51,Analysis!C$37,0)+IF(VLOOKUP($A$38,'INPUT DATA'!$D$39:$E$46,2,FALSE)=Analysis!$B51,Analysis!C$38,0)+IF(VLOOKUP($A$39,'INPUT DATA'!$D$39:$E$46,2,FALSE)=Analysis!$B51,Analysis!C$39,0)+IF(VLOOKUP($A$40,'INPUT DATA'!$D$39:$E$46,2,FALSE)=Analysis!$B51,Analysis!C$40,0)+IF(VLOOKUP($A$41,'INPUT DATA'!$D$39:$E$46,2,FALSE)=Analysis!$B51,Analysis!C$41,0)+IF(VLOOKUP($A$42,'INPUT DATA'!$D$39:$E$46,2,FALSE)=Analysis!$B51,Analysis!C$42,0)

In the Input Data tab we have a list of codes to lookup to see if they are noted as 'Flat cash' or 'projects'

T1A000Flat Cash
T8A000Flat Cash
T1B510Flat Cash
T1B540Flat Cash
T1B542Flat Cash
TSA001Flat Cash
U9A000Flat Cash
U9B573Flat Cash
M9T000Projects


<colgroup><col width="64" style="width: 48pt;" span="2">
<tbody>




































</tbody>
if the numbers are flat cash I need them to total up the amount in the next table and give me the total number, same for projects. this is the table where the numbers are pulling from:

P5BIS Facilities
FINANCIAL FORECASTING 2016/17
Analysis by Job CodeActualActualForecastForecastForecastForecastForecastForecastForecastForecastForecastForecast
Net Expenditure123456789101112
T1A000GENERAL IS OPERATING COSTS3,939 988 1,187 1,187 1,187 1,187 1,186 1,186 1,189 1,189 1,189 1,189
T8A000GENERAL SERVICE PROVISION0 0 0 0 0 0 0 0 0 0 0 0
T1B510FLEET VEHICLES337 126 0 0 0 0 0 0 0 0 0 0
T1B540ML SECURITY0 0 0 0 0 0 5,500 0 0 0 0 0
T1B542OTHER SITE SECURITY0 0 0 0 0 0 750 0 0 0 0 0
TSA001IS SALARY CHARGES31,112 33,654 33,208 33,208 33,208 33,208 33,208 33,207 33,207 33,208 33,208 33,208
U9A000GENERAL COMPUTING EQUIPMENT0 0 0 0 0 0 0 0 0 0 0 0
U9B573OCCUPATIONAL HEALTH EQUIPMENT0 0 0 0 0 0 300 0 0 0 0 0
Net Expenditure35,38834,76834,39534,39534,39534,39540,94434,39334,39634,39734,39734,397

<tbody>
</tbody><colgroup><col><col><col span="12"></colgroup>

As you can see from the above vlookup formula it is far too long. Do you have any suggestions of how this could be condensed and made more robust?

Thank you,
Peggy
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
What do you mean by 'more robust'? Are you in fact just looking for a shorter formula that does the same job, or is there something about the formula you are using that does not work?
 
Upvote 0
Hi Ali,

Yes to both questions! The formula is being very temperamental - it doesn't like adding up the Projects totals. Ideally a shorter formula would be a big help!

Thanks,
Peggy
 
Upvote 0
are you happy with a helper column (that can be hidden), if so, try this


Excel 2012
ABCDEFGHIJKLMNO
1T1A000Flat CashGENERAL IS OPERATING COSTS3,9399881,1871,1871,1871,1871,1861,1861,1891,1891,1891,189
2T8A000Flat CashGENERAL SERVICE PROVISION000000000000
3T1B510Flat CashFLEET VEHICLES3371260000000000
4T1B540Flat CashML SECURITY0000005,50000000
5T1B542Flat CashOTHER SITE SECURITY00000075000000
6TSA001Flat CashIS SALARY CHARGES31,11233,65433,20833,20833,20833,20833,20833,20733,20733,20833,20833,208
7U9A000Flat CashGENERAL COMPUTING EQUIPMENT000000000000
8U9B573Flat CashOCCUPATIONAL HEALTH EQUIPMENT00000030000000
9M9T000ProjectsTesting12,34512,345
10Net Expenditure35,38834,76834,39534,39534,39534,39540,94434,39334,39634,39734,39734,397
11Flat Cash35,38834,76834,39534,39534,39534,39540,94434,39334,39634,39734,39734,397
12Projects12,3450012,34500000000
13
14T1A000Flat Cash
15T8A000Flat Cash
16T1B510Flat Cash
17T1B540Flat Cash
18T1B542Flat Cash
19TSA001Flat Cash
20U9A000Flat Cash
21U9B573Flat Cash
22M9T000Projects
Sheet2
Cell Formulas
RangeFormula
B1=VLOOKUP(A1,$A$14:$B$22,2,0)
D11=SUMIF($B$1:$B$9,$C11,D$1:D$9)
 
Upvote 0
are you happy with a helper column (that can be hidden), if so, try this

Excel 2012
ABCDEFGHIJKLMNO
1T1A000Flat CashGENERAL IS OPERATING COSTS3,9399881,1871,1871,1871,1871,1861,1861,1891,1891,1891,189
2T8A000Flat CashGENERAL SERVICE PROVISION000000000000
3T1B510Flat CashFLEET VEHICLES3371260000000000
4T1B540Flat CashML SECURITY0000005,50000000
5T1B542Flat CashOTHER SITE SECURITY00000075000000
6TSA001Flat CashIS SALARY CHARGES31,11233,65433,20833,20833,20833,20833,20833,20733,20733,20833,20833,208
7U9A000Flat CashGENERAL COMPUTING EQUIPMENT000000000000
8U9B573Flat CashOCCUPATIONAL HEALTH EQUIPMENT00000030000000
9M9T000ProjectsTesting12,34512,345
10Net Expenditure35,38834,76834,39534,39534,39534,39540,94434,39334,39634,39734,39734,397
11Flat Cash35,38834,76834,39534,39534,39534,39540,94434,39334,39634,39734,39734,397
12Projects12,3450012,34500000000
13
14T1A000Flat Cash
15T8A000Flat Cash
16T1B510Flat Cash
17T1B540Flat Cash
18T1B542Flat Cash
19TSA001Flat Cash
20U9A000Flat Cash
21U9B573Flat Cash
22M9T000Projects

<colgroup><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet2

Worksheet Formulas
CellFormula
B1=VLOOKUP(A1,$A$14:$B$22,2,0)
D11=SUMIF($B$1:$B$9,$C11,D$1:D$9)

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>

Hi AlanY,
Thanks for the help with the formulas. This is working much better now!!
Best wishes,
Peggy
 
Upvote 0

Forum statistics

Threads
1,215,328
Messages
6,124,299
Members
449,149
Latest member
mwdbActuary

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