Excel Array Formula

ziad alsayed

Well-known Member
Joined
Jul 17, 2010
Messages
665
dear all

please is an array formula (CTRL+SHIFT+ENTER), is it possible to make i smaller

Appreciate any help

Code:
=SUM(VLOOKUP($A5,'PHC 2011'!$A:$CH,MATCH(CONCATENATE($A$1,C$4),CONCATENATE('PHC 2011'!$3:$3,'PHC 2011'!$4:$4),0),0),VLOOKUP($A5,'Apapa 2011'!$A:$CH,MATCH(CONCATENATE($A$1,C$4),CONCATENATE('Apapa 2011'!$3:$3,'Apapa 2011'!$4:$4),0),0),VLOOKUP($A5,'VI 2011'!$A:$CH,MATCH(CONCATENATE($A$1,C$4),CONCATENATE('VI 2011'!$3:$3,'VI 2011'!$4:$4),0),0),VLOOKUP($A5,'Kano 2011'!$A:$CH,MATCH(CONCATENATE($A$1,C$4),CONCATENATE('Kano 2011'!$3:$3,'Kano 2011'!$4:$4),0),0),VLOOKUP($A5,'Ikeja 2011'!$A:$CH,MATCH(CONCATENATE($A$1,C$4),CONCATENATE('Ikeja 2011'!$3:$3,'Ikeja 2011'!$4:$4),0),0))
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Hard to say what would work best, however, you have repeated the same formula five times. Maybe some more explanation is required.

What you could use is Indirect. With the first formula I have used F1 to toggle between sheets. Don't know if you want one sheet summed at a time or all. If you want all then the second version could help. Find a range somewhere on your spreadsheet and list the five sheets and then name the range SheetList.

Code:
=SUM(
     VLOOKUP($A5,INDIRECT("'"&F1&"'!$A$1:$CH$65536"),
     MATCH(CONCATENATE($A$1,C$4),
     CONCATENATE(INDIRECT("'"&F1&"'!$A$3:$IV$4")),0),0))

Code:
=SUM(
     VLOOKUP($A5,INDIRECT("'"&SheetList&"'!$A$1:$CH$65536"),
     MATCH(CONCATENATE($A$1,C$4),
     CONCATENATE(INDIRECT("'"&SheetList&"'!$A$3:$IV$4")),0),0))
 
Upvote 0
dear Jeff

thanks for the reply ,what i need is the second option, which will Sum the value from each sheet and put in a Sheet named "Nigeria".

the formula you sent is not working.

what i am doing is to sum from the Five sheets base on the criteria i Chooose in the "Nigeria" Sheet ( in cell A1).

the format is too big i posted below part of it , i hope it can help .
thanks again
Excel Workbook
ABC
1
2PHC 2011
3SIZEJan/11
4RangeModelMTN
5L12.5LPW339
6L17.5LPW439
7L17.5DSLPW439
8L17.5LRLPW439
9P13.5E2403C-15G39
10P18E2404C-22G139
11P22E2404C-22G239
12P273.152439
PHC 2011
Excel 2010
Excel Workbook
ABC
1
2Apapa 2011
3SIZEJan/11
4RangeModelMTN
5L12.5LPW32
6L17.5LPW42
7L17.5DSLPW42
8L17.5LRLPW42
9P13.5E2403C-15G2
10P18E2404C-22G12
11P22E2404C-22G22
12P273.15242
Apapa 2011
Excel 2010
Excel Workbook
ABC
1
2VI 2011
3SIZEJan/11
4RangeModelMTN
5L12.5LPW351
6L17.5LPW451
7L17.5DSLPW451
8L17.5LRLPW451
9P13.5E2403C-15G51
10P18E2404C-22G151
11P22E2404C-22G251
12P273.152451
VI 2011
Excel 2010
Excel Workbook
ABC
1
2kano 2011
3SIZEJan/11
4RangeModelMTN
5L12.5LPW326
6L17.5LPW426
7L17.5DSLPW426
8L17.5LRLPW426
9P13.5E2403C-15G26
10P18E2404C-22G126
11P22E2404C-22G226
12P273.152426
Kano 2011
Excel 2010
Excel Workbook
ABC
1
2Ikeja 2011
3SIZE####
4RangeModelMTN
5L12.5LPW314
6L17.5LPW414
7L17.5DSLPW414
8L17.5LRLPW414
9P13.5E2403C-15G14
10P18E2404C-22G114
11P22E2404C-22G214
12P273.152414
Ikeja 2011
Excel 2010
Excel Workbook
ABC
1Jan/11
2NIGERIAGENSETS
3SIZENb. Of Gensets
4RangeModelMTN
5L12.5LPW3132
6L17.5LPW4132
7L17.5DSLPW4132
8L17.5LRLPW4132
9P13.5E2403C-15G132
10P18E2404C-22G1132
11P22E2404C-22G2132
12P273.1524132
Nigeria
Excel 2010
Cell Formulas
RangeFormula
A5='C:\Users\dv7\Desktop\[MC Summary 1101.xlsx]Ikeja'!A5
A6='C:\Users\dv7\Desktop\[MC Summary 1101.xlsx]Ikeja'!A6
A9='C:\Users\dv7\Desktop\[MC Summary 1101.xlsx]Ikeja'!A9
A10='C:\Users\dv7\Desktop\[MC Summary 1101.xlsx]Ikeja'!A10
A11='C:\Users\dv7\Desktop\[MC Summary 1101.xlsx]Ikeja'!A11
A12='C:\Users\dv7\Desktop\[MC Summary 1101.xlsx]Ikeja'!A12
B5='C:\Users\dv7\Desktop\[MC Summary 1101.xlsx]Ikeja'!B5
B6='C:\Users\dv7\Desktop\[MC Summary 1101.xlsx]Ikeja'!B6
B9='C:\Users\dv7\Desktop\[MC Summary 1101.xlsx]Ikeja'!B9
B10='C:\Users\dv7\Desktop\[MC Summary 1101.xlsx]Ikeja'!B10
B11='C:\Users\dv7\Desktop\[MC Summary 1101.xlsx]Ikeja'!B11
B12='C:\Users\dv7\Desktop\[MC Summary 1101.xlsx]Ikeja'!B12
#VALUE!
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
 
Upvote 0
For starters how about...

Cell C5 and drag down...
=SUMPRODUCT(SUMIF(INDIRECT("'"&SheetList&"'!A:A"),A5,INDIRECT("'"&SheetList&"'!C:C")))

Make sure you create a named range with the five sheet names a call in SheetList

Also, just as a side note. When using Jeanie you can specify which cells to produce as formulas. Since you formulas in C5:C12 and basically duplicates you need only show one. Just saves spaces.
 
Upvote 0
dear Jeff

Maybe i didn't explain well, though the "formula works for one month". but it is not what i need.

below is what i have in each sheet and for 12 month(i just posted one month). i have to meet two criteria to get the data into Nigeria Sheet.( i just posted PHC 2011) as example.
Excel Workbook
ABCDEFGHI
1
2PHC 2011
3SIZEJan/11Jan/11Jan/11Jan/11Jan/11Jan/11
4RangeModelMTNStarZainSIMSMCOth.Total
5L12.5LPW3393939393939234
6L17.5LPW4393939393939234
7L17.5DSLPW4393939393939234
8L17.5LRLPW4393939393939234
9P13.5E2403C-15G393939393939234
10P18E2404C-22G1393939393939234
11P22E2404C-22G2393939393939234
12P273.1524393939393939234
PHC 2011
Excel 2010
Cell Formulas
RangeFormula
I5=SUM(C5:H5)
I6=SUM(C6:H6)
I7=SUM(C7:H7)
I8=SUM(C8:H8)
I9=SUM(C9:H9)
I10=SUM(C10:H10)
I11=SUM(C11:H11)
I12=SUM(C12:H12)


also in Nigeria below is what i have only
Excel Workbook
ABCDEFGHI
1Jan/11
2NIGERIAGENSETS
3SIZENb. Of Gensets
4RangeModelMTNStarZainSIMSMCOth.Total
5L12.5LPW3132132132132132132792
6L17.5LPW4132132132132132132792
7L17.5DSLPW4132132132132132132792
8L17.5LRLPW4132132132132132132792
9P13.5E2403C-15G132132132132132132792
10P18E2404C-22G1132132132132132132792
11P22E2404C-22G2132132132132132132792
12P273.1524132132132132132132792
Nigeria
Excel 2010

i hope it is clear.
thanks for the assistance
 
Upvote 0
I was thinking that Sumifs might be the next option, but I'm having trouble making it work.

Maybe somebody else can help us out.
 
Upvote 0
Thanks Jeffs for your assistance and that time you put.

i am sure somebody can assist us:), i hope so.

take care.
 
Upvote 0
Hi Ziad,

I somehow feel I may not have all the right information here for the correct solution. With the data you have posted it seems all the table are the same so you are just making a summary sheet.

If this is so, why wouldn't this work.

=SUM('VI 2011:Ikeja 2011'!C5)
 
Upvote 0
hi jeff

i wish if it was easy like that :), still not what i need. if it is ok by you i have no problem sending you the file.

please advise.
 
Upvote 0

Forum statistics

Threads
1,224,598
Messages
6,179,820
Members
452,946
Latest member
JoseDavid

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