Urgent SUMPRODUCT Does not work.

jamilm

Well-known Member
Joined
Jul 21, 2011
Messages
740
Gurus,

i am confused, and i do not know what i am really missing. i am putting the condition of sumproduct but it does return the correct value. it returns the total and the criteria filter does not work.

please take a look into the file uploaded in link https://skydrive.live.com/redir?resid=D7C00A2BF29043E0!282&authkey=!ACMnN7l5sNul-XM

Sheet1 is source of data and sheet2 is where i want to put my formula in columb B SUMPRODUCT to sum the sumrange of sheet1 based on the criteria to match the country.

appreciate your help.


Excel 2010
ABCDEFGHIJKLMNOPQR
1Countries1997199819992000200120022003200420052006200720082009201020112012Totals
2Abu Dhabi937526.00711676.00127258.00412124.00181343.00148693.0083602.00705321.00175918.0027216.00623127.00413801.00672402.0092748.00785860.00518927.006617542.00
3Afghanistan544978.00864802.00328557.00398491.00151009.00169373.00570641.00174884.00773938.00886205.00189563.0013662.00376837.0067268.00745799.00964773.007220780.00
4Albania722178.00607479.00409183.00849599.00986586.00182140.00605838.00693561.00877480.0063517.00213071.00482273.00355700.00129737.00847960.00694915.008721217.00
5Algeria928072.00951906.00685024.00595924.00182293.00407607.00815725.0048995.00935532.00581201.00179045.00221596.00342495.00510717.00449213.00884393.008719738.00
6American Samoa857344.00814831.00542987.00580172.00821140.00498886.0065486.0024883.00179550.00940157.00465544.00737757.00587136.0087497.00650218.00994682.008848270.00
7Andorra355476.00526425.00428967.00185387.00112257.00273832.00236346.00663817.00724760.00651659.0029520.00353506.00626720.005168672.00
8Angola180453.00778205.00557528.00745210.00254977.00165896.00417137.00981202.00112558.00662935.00944493.00158502.00557652.00824050.00451590.00696412.008488800.00
9Anguilla965489.00539975.00481887.00783462.00443992.00328277.00291094.00868261.00252561.00110590.00208467.00427815.00134111.00961677.00752719.00626397.008176774.00
10Antarctica746210.00667204.00499435.00738105.00737376.00213987.00531707.00531162.00674346.00269192.00538664.00737290.0048330.00586768.00727566.00463294.008710636.00
11Antigua:Barbuda871815.00667126.00626736.00734106.00537175.00547782.00144702.0026291.00671698.0091836.00640484.0059809.00100967.00362451.00282105.00992003.007357086.00
12Argentina302202.00612481.0070455.00956737.00353323.00257251.008892.00983000.00378057.00422215.00933361.00824528.00517971.0044786.00554092.00797717.008017068.00
13Armenia765227.00177623.00600643.00183609.00251758.00161249.00590328.00554474.00993286.00634491.00350483.00531153.00343998.00352373.00908402.0098625.007497722.00
14Aruba308829.00196117.00232432.00863837.00961369.00407216.00280974.00968869.00753712.00947885.00453303.00731810.00273038.007379391.00
15Austral Oceania293817.00420002.00420884.00931570.00173905.00793280.0036321.00517644.00958358.00782425.00466878.00209224.00890333.00749790.00886731.00406176.008937338.00
16Australia320673.00348176.00272120.00895560.00756822.00953593.00816967.00218470.00332683.00665997.00277627.00250978.00648811.00220082.00603331.00540796.008122686.00
17Austria917145.00814099.00232169.00555706.00820870.00971075.00660254.00230117.00639540.00508702.0069443.00431686.00963865.00879475.00758393.0015686.009468225.00
18Azerbaijan965129.00627219.00187870.00114325.00576949.00262992.00638246.00467506.00739100.00351699.00597152.00452789.0018453.00317744.00982923.00444441.007744537.00
19Bahamas786398.00781888.00746064.00363161.00928443.00602711.009193.0079837.00799828.00733154.00498498.00960061.00132898.00357905.00770207.00697289.009247535.00
20Bahrain220249.00696354.00362664.00743280.00923535.00584035.00741696.00439483.00917232.00874141.00817656.00946701.0024687.00306877.00293172.00821157.009712919.00
21Bangladesh494660.00872843.00397344.00327041.00785574.0023482.00238176.00786651.00336705.00642325.00349725.00847199.00483065.00634862.00917144.00402602.008539398.00
22Barbados743509.00236583.00973610.00682360.00733647.00966871.00928264.00146517.00485258.00552076.00831570.00452946.007733211.00
23Belarus473324.00640538.00476508.00580576.00478323.00723255.00615947.00154723.00141933.00274495.00847180.00731750.006138552.00
24Belgium31444.00755835.00182955.00318377.00753323.00630496.00251102.00861636.00451012.00679682.00481492.00238586.005635940.00
25Belgium-Luxem.621043.00154289.00730073.00937618.00201640.00806830.00705419.00466874.00341075.00563040.00833703.0033152.006394756.00
26Belize272482.00302982.00976806.00421593.00242862.00319049.00951608.00238969.0049153.00511839.00406030.00265577.004958950.00
27Benin780060.00558709.00833655.00721889.00771842.00126456.00852886.00956987.00151708.0077530.00827289.00181755.006840766.00
28Bermuda670778.00470938.00935723.00432966.00840120.0025133.005922.00825077.0055776.00124678.00199117.00127869.004714097.00
29Bhutan840703.00621693.00183970.00324381.00126021.00581994.00111329.00804995.00519017.00304643.00477513.00163101.00765638.00187605.00329273.00193723.006535599.00
30Bolivia223536.00554113.00735413.00710400.00100886.0015385.00921030.00825137.00582626.00420938.00561120.00531022.00456317.00312142.00699126.0011087.007660278.00
31Bonaire524639.00959088.00197217.00786444.00431270.0060926.00338509.00682118.0014374.00270126.00732451.00879161.006903.00373135.00315900.00904674.007476935.00
32Bosnia & Herz.904171.00669850.00926639.00150594.00686516.00838620.00128344.00350546.00596315.00370644.00520203.00560840.00320888.00403504.00167765.00399856.007995295.00
33Botswana499262.00572952.0033571.00947266.00151588.00352496.0044132.00268118.00603600.00991227.00266802.0071502.00528354.00776880.00719881.00312401.007140032.00
34Bouvet Island799794.00398349.00854222.00761757.007595.00450894.0069092.00136505.00469986.00125629.00370652.0091239.00259313.00392166.00964373.00674124.006825690.00
35Br Ind Oc Terr735262.00754270.00394101.00438565.00941353.00408716.00755872.00807967.0045685.00977331.00689007.0029785.00938033.00691868.00455479.00228332.009291626.00
36Br Virgin Is346770.00638654.0044270.00208166.00205256.00145644.00737296.0035990.00111447.00670231.00724311.00920428.00481593.00668509.00252482.0093548.006284595.00
37Brazil976186.00550515.0031598.00179050.0036502.00152528.00126635.00219462.0034528.00321369.00604021.00430329.00660585.00875030.00374718.00340483.005913539.00
38Brunei371630.00492992.00267577.00265543.00704446.00248897.00977087.00918780.00517135.00842921.00302525.00942834.0096297.00505730.00565444.00489457.008509295.00
39Bulgaria489854.00158988.00249951.00775585.00917596.00465874.00740503.00625140.00597253.00944977.00331276.006296997.00
40Burkina97446.00822169.00240510.0023310.0091890.00355228.00196201.00302240.00279736.00220839.00666268.003295837.00
41Burma661.00562744.00970128.00214630.00332825.00166796.00492384.00434506.00998775.00228859.00941775.005344083.00
42Burundi726298.00780712.00750963.00807801.00977219.00513221.00323043.00218567.00214809.005312633.00
43Cambodia210209.00676742.00682897.0069089.00372757.00460786.00753663.0015159.00627889.003869191.00
44Cameroon956564.00165906.00934386.006542.00879015.00576356.00737480.00366965.00207948.004831162.00
45Canada67282.00529690.00216369.00300016.00265453.00865015.00713846.00831332.00787154.004576157.00
46Canary Islands346197.00632205.00584615.00542025.00482072.004696.0030833.001021.00326099.002949763.00
47Cape Verde766789.00753738.00102898.00286404.00657922.00406033.00734510.00183834.00106841.003998969.00
48Cayman Islands401281.00854459.00918881.00948431.00548604.00206654.00660730.00723741.00159660.00122490.00608318.00182202.00800488.00900942.008036881.00
49Cent Afr Rep351701.00857309.00876121.00235583.00389388.0013879.00480054.00985453.00344428.0036547.00841194.00754651.00198660.00659810.007024778.00
50334281941.00
Sheet1
Cell Formulas
RangeFormula
R2=SUM(B2:Q2)
R3=SUM(B3:Q3)
R4=SUM(B4:Q4)
R5=SUM(B5:Q5)
R6=SUM(B6:Q6)
R7=SUM(B7:Q7)
R8=SUM(B8:Q8)
R9=SUM(B9:Q9)
R10=SUM(B10:Q10)
R11=SUM(B11:Q11)
R12=SUM(B12:Q12)
R13=SUM(B13:Q13)
R14=SUM(B14:Q14)
R15=SUM(B15:Q15)
R16=SUM(B16:Q16)
R17=SUM(B17:Q17)
R18=SUM(B18:Q18)
R19=SUM(B19:Q19)
R20=SUM(B20:Q20)
R21=SUM(B21:Q21)
R22=SUM(B22:Q22)
R23=SUM(B23:Q23)
R24=SUM(B24:Q24)
R25=SUM(B25:Q25)
R26=SUM(B26:Q26)
R27=SUM(B27:Q27)
R28=SUM(B28:Q28)
R29=SUM(B29:Q29)
R30=SUM(B30:Q30)
R31=SUM(B31:Q31)
R32=SUM(B32:Q32)
R33=SUM(B33:Q33)
R34=SUM(B34:Q34)
R35=SUM(B35:Q35)
R36=SUM(B36:Q36)
R37=SUM(B37:Q37)
R38=SUM(B38:Q38)
R39=SUM(B39:Q39)
R40=SUM(B40:Q40)
R41=SUM(B41:Q41)
R42=SUM(B42:Q42)
R43=SUM(B43:Q43)
R44=SUM(B44:Q44)
R45=SUM(B45:Q45)
R46=SUM(B46:Q46)
R47=SUM(B47:Q47)
R48=SUM(B48:Q48)
R49=SUM(B49:Q49)
R50=SUM(R2:R49)





sheet2


Excel 2010
AB
1CountriesSum of Total Years with SUMPRODUCT
2Abu Dhabi334281941.00
3Afghanistan
4Albania
5Algeria
6American Samoa
7Andorra
8Angola
9Anguilla
10Antarctica
11Antigua:Barbuda
12Argentina
13Armenia
14Aruba
15Austral Oceania
16Australia
17Austria
18Azerbaijan
19Bahamas
20Bahrain
21Bangladesh
22Barbados
23Belarus
24Belgium
25Belgium-Luxem.
26Belize
27Benin
28Bermuda
29Bhutan
30Bolivia
31Bonaire
32Bosnia & Herz.
33Botswana
34Bouvet Island
35Br Ind Oc Terr
36Br Virgin Is
37Brazil
Sheet2
Cell Formulas
RangeFormula
B2=SUMPRODUCT(SUMRANGE)*--ISNUMBER(MATCH(A2,DynamicRange,0))
Named Ranges
NameRefers ToCells
DynamicRange=Sheet1!$A$1:INDEX(Sheet1!$A:$A,Lastrow)
SUMRANGE=Sheet1!$B$2:$Q$49
 
Thank you very much Aladin. I would say you are indeed the King of Formulas.

I have never seen a person knowledgable like you to this extend in excel functions.








Everybody is happily producing things like X*--(Y). This is something incoherent, not worth to be wedded to.

If you don't have any formulas in column A on Sheet1...

Define Lrow with Sheet1 as Scope as referring to:

=MATCH(REPT("z",255),Sheet1!$A:$A)

Define ConditionRange as referring to:

=Sheet1!$A$1:INDEX(Sheet1!$A:$A,Sheet1!Lrow)

Define SumRange as referring to:

=Sheet1!$B$1:INDEX(Sheet1!$Q:$Q,Sheet1!Lrow)


Note 1. Restricting the scope of Lrow to Sheet1, allows you to use the same name also in other sheets.

Note 2. ConditionRange and SumRange are equally sized in the vertical dimension.

Note 3. With the dynamic name ranges we just defined, we can invoke formulas on Sheet2 like:

[1] just enter:

=SUMPRODUCT(SumRange*(ConditionRange=$A2))

[2] just enter:

=SUMPRODUCT(SumRange*ISNUMBER(MATCH(ConditionRange,$A2,0)))

[3] just enter:

=SUMPRODUCT(SumRange*ISNUMBER(SEARCH($A2,ConditionRange)))

[4] control+shift+enter, not just enter:

=SUM(IF(ConditionRange=$A2,SumRange)

[5] control+shift+enter, not just enter:

=SUM(IF(ISNUMBER(MATCH(ConditionRange,$A2,0)),SumRange)

[6] control+shift+enter, not just enter:

=SUM(IF(ISNUMBER(SEARCH($A2,ConditionRange)),SumRange)

Note 3. The following formula, similar to the one you have,

SUMPRODUCT(SumRange*ISNUMBER(MATCH($A2,ConditionRange,0)))

is wrong for MATCH here cannot but return a single value, not a set of values as required.

Note 4. The SumProduct formulas, [1] to [3] above, are sensitive to the text values (like blanks) in SumRange. Better to switch to a form like in 4 to 6 whenever you have to mix vectors with matrices.
 
Upvote 0

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Dear Aladin,

i have one challenging difficult problem with Formula. not sure what combination of functions it requires to produce the desired result

Sheet1 one is source data where the column headers are dates like this format for example 01/31/2013 shown as Jan-2013 mmm-yyyy
Now Sheet2 is where, the numbers needs to be pulled from sheet1 and summed in Sheet2. but the main problem is that the column headers in sheet2 are not dates but they are texts with multi months. for example one column has Jan-Mar 2013. so is there any possibility for any formula to match country name and then the column header of multi months of sheet2 with column months of sheet1 and calculate the matched one. for example in second row for Abu Dhabi sheet2 , it matches with Sheet1 second row and then it should look in column headers of sheet2 which indicates multiple months . so for example amounts in sheet1 Jan, Feb and March to be summed in Sheet2 Column B Abu Dhabi which is row 2. becuase the header of sheet2 is Jan-Mar 2013

the example file is available in this link https://skydrive.live.com/redir?resid=D7C00A2BF29043E0!283&authkey=!AGT3V33Wt9HWs60 also the screenshots are attached.

I greatly appreciate your help as usual. thank you.

Sheet1 Data

[TABLE="width: 694"]
<colgroup><col><col><col><col><col><col><col><col><col><col><col><col><col></colgroup><tbody>[TR]
[TD]Countries[/TD]
[TD]Jan-13[/TD]
[TD]Feb-13[/TD]
[TD]Mar-13[/TD]
[TD]Apr-13[/TD]
[TD]May-13[/TD]
[TD]Jun-13[/TD]
[TD]Jul-13[/TD]
[TD]Aug-13[/TD]
[TD]Sep-13[/TD]
[TD]Oct-13[/TD]
[TD]Nov-13[/TD]
[TD]Dec-13[/TD]
[/TR]
[TR]
[TD]Abu Dhabi[/TD]
[TD="align: right"]2852[/TD]
[TD="align: right"]194[/TD]
[TD="align: right"]334[/TD]
[TD="align: right"]57[/TD]
[TD="align: right"]181[/TD]
[TD="align: right"]197[/TD]
[TD="align: right"]180[/TD]
[TD="align: right"]214[/TD]
[TD="align: right"]173[/TD]
[TD="align: right"]107[/TD]
[TD="align: right"]45[/TD]
[TD="align: right"]20[/TD]
[/TR]
[TR]
[TD]Afghanistan[/TD]
[TD="align: right"]2144[/TD]
[TD="align: right"]487[/TD]
[TD="align: right"]78[/TD]
[TD="align: right"]482[/TD]
[TD="align: right"]73[/TD]
[TD="align: right"]405[/TD]
[TD="align: right"]244[/TD]
[TD="align: right"]390[/TD]
[TD="align: right"]305[/TD]
[TD="align: right"]175[/TD]
[TD="align: right"]443[/TD]
[TD="align: right"]237[/TD]
[/TR]
[TR]
[TD]Albania[/TD]
[TD="align: right"]689[/TD]
[TD="align: right"]236[/TD]
[TD="align: right"]176[/TD]
[TD="align: right"]87[/TD]
[TD="align: right"]303[/TD]
[TD="align: right"]86[/TD]
[TD="align: right"]254[/TD]
[TD="align: right"]55[/TD]
[TD="align: right"]256[/TD]
[TD="align: right"]398[/TD]
[TD="align: right"]367[/TD]
[TD="align: right"]271[/TD]
[/TR]
[TR]
[TD]Algeria[/TD]
[TD="align: right"]2028[/TD]
[TD="align: right"]239[/TD]
[TD="align: right"]53[/TD]
[TD="align: right"]114[/TD]
[TD="align: right"]114[/TD]
[TD="align: right"]243[/TD]
[TD="align: right"]447[/TD]
[TD="align: right"]124[/TD]
[TD="align: right"]359[/TD]
[TD="align: right"]194[/TD]
[TD="align: right"]310[/TD]
[TD="align: right"]58[/TD]
[/TR]
[TR]
[TD]American Samoa[/TD]
[TD="align: right"]895[/TD]
[TD="align: right"]492[/TD]
[TD="align: right"]414[/TD]
[TD="align: right"]453[/TD]
[TD="align: right"]376[/TD]
[TD="align: right"]177[/TD]
[TD="align: right"]218[/TD]
[TD="align: right"]300[/TD]
[TD="align: right"]254[/TD]
[TD="align: right"]62[/TD]
[TD="align: right"]76[/TD]
[TD="align: right"]444[/TD]
[/TR]
[TR]
[TD]Andorra[/TD]
[TD="align: right"]365[/TD]
[TD="align: right"]254[/TD]
[TD="align: right"]79[/TD]
[TD="align: right"]73[/TD]
[TD="align: right"]376[/TD]
[TD="align: right"]442[/TD]
[TD="align: right"]251[/TD]
[TD="align: right"]492[/TD]
[TD="align: right"]499[/TD]
[TD="align: right"]416[/TD]
[TD="align: right"]340[/TD]
[TD="align: right"]231[/TD]
[/TR]
[TR]
[TD]Angola[/TD]
[TD="align: right"]1135[/TD]
[TD="align: right"]382[/TD]
[TD="align: right"]417[/TD]
[TD="align: right"]91[/TD]
[TD="align: right"]465[/TD]
[TD="align: right"]304[/TD]
[TD="align: right"]98[/TD]
[TD="align: right"]482[/TD]
[TD="align: right"]456[/TD]
[TD="align: right"]454[/TD]
[TD="align: right"]398[/TD]
[TD="align: right"]160[/TD]
[/TR]
[TR]
[TD]Anguilla[/TD]
[TD="align: right"]2448[/TD]
[TD="align: right"]335[/TD]
[TD="align: right"]349[/TD]
[TD="align: right"]407[/TD]
[TD="align: right"]330[/TD]
[TD="align: right"]30[/TD]
[TD="align: right"]276[/TD]
[TD="align: right"]358[/TD]
[TD="align: right"]161[/TD]
[TD="align: right"]28[/TD]
[TD="align: right"]398[/TD]
[TD="align: right"]102[/TD]
[/TR]
[TR]
[TD]Antarctica[/TD]
[TD="align: right"]4958[/TD]
[TD="align: right"]193[/TD]
[TD="align: right"]212[/TD]
[TD="align: right"]389[/TD]
[TD="align: right"]97[/TD]
[TD="align: right"]187[/TD]
[TD="align: right"]236[/TD]
[TD="align: right"]159[/TD]
[TD="align: right"]323[/TD]
[TD="align: right"]86[/TD]
[TD="align: right"]115[/TD]
[TD="align: right"]336[/TD]
[/TR]
[TR]
[TD]Antigua:Barbuda[/TD]
[TD="align: right"]113[/TD]
[TD="align: right"]92[/TD]
[TD="align: right"]139[/TD]
[TD="align: right"]63[/TD]
[TD="align: right"]276[/TD]
[TD="align: right"]32[/TD]
[TD="align: right"]292[/TD]
[TD="align: right"]456[/TD]
[TD="align: right"]267[/TD]
[TD="align: right"]101[/TD]
[TD="align: right"]177[/TD]
[TD="align: right"]462[/TD]
[/TR]
[TR]
[TD]Argentina[/TD]
[TD="align: right"]1695[/TD]
[TD="align: right"]381[/TD]
[TD="align: right"]353[/TD]
[TD="align: right"]42[/TD]
[TD="align: right"]98[/TD]
[TD="align: right"]216[/TD]
[TD="align: right"]357[/TD]
[TD="align: right"]138[/TD]
[TD="align: right"]191[/TD]
[TD="align: right"]18[/TD]
[TD="align: right"]431[/TD]
[TD="align: right"]367[/TD]
[/TR]
[TR]
[TD]Armenia[/TD]
[TD="align: right"]3338[/TD]
[TD="align: right"]72[/TD]
[TD="align: right"]418[/TD]
[TD="align: right"]463[/TD]
[TD="align: right"]297[/TD]
[TD="align: right"]486[/TD]
[TD="align: right"]59[/TD]
[TD="align: right"]269[/TD]
[TD="align: right"]470[/TD]
[TD="align: right"]85[/TD]
[TD="align: right"]178[/TD]
[TD="align: right"]15[/TD]
[/TR]
[TR]
[TD]Aruba[/TD]
[TD="align: right"]3933[/TD]
[TD="align: right"]363[/TD]
[TD="align: right"]478[/TD]
[TD="align: right"]102[/TD]
[TD="align: right"]373[/TD]
[TD="align: right"]79[/TD]
[TD="align: right"]418[/TD]
[TD="align: right"]70[/TD]
[TD="align: right"]490[/TD]
[TD="align: right"]316[/TD]
[TD="align: right"]381[/TD]
[TD="align: right"]121[/TD]
[/TR]
[TR]
[TD]Austral Oceania[/TD]
[TD="align: right"]3377[/TD]
[TD="align: right"]158[/TD]
[TD="align: right"]191[/TD]
[TD="align: right"]219[/TD]
[TD="align: right"]206[/TD]
[TD="align: right"]183[/TD]
[TD="align: right"]448[/TD]
[TD="align: right"]327[/TD]
[TD="align: right"]224[/TD]
[TD="align: right"]126[/TD]
[TD="align: right"]158[/TD]
[TD="align: right"]156[/TD]
[/TR]
[TR]
[TD]Australia[/TD]
[TD="align: right"]4751[/TD]
[TD="align: right"]436[/TD]
[TD="align: right"]155[/TD]
[TD="align: right"]113[/TD]
[TD="align: right"]224[/TD]
[TD="align: right"]316[/TD]
[TD="align: right"]256[/TD]
[TD="align: right"]462[/TD]
[TD="align: right"]124[/TD]
[TD="align: right"]455[/TD]
[TD="align: right"]446[/TD]
[TD="align: right"]149[/TD]
[/TR]
[TR]
[TD]Austria[/TD]
[TD="align: right"]2116[/TD]
[TD="align: right"]268[/TD]
[TD="align: right"]208[/TD]
[TD="align: right"]464[/TD]
[TD="align: right"]245[/TD]
[TD="align: right"]234[/TD]
[TD="align: right"]317[/TD]
[TD="align: right"]255[/TD]
[TD="align: right"]142[/TD]
[TD="align: right"]125[/TD]
[TD="align: right"]176[/TD]
[TD="align: right"]317[/TD]
[/TR]
[TR]
[TD]Azerbaijan[/TD]
[TD="align: right"]4982[/TD]
[TD="align: right"]344[/TD]
[TD="align: right"]410[/TD]
[TD="align: right"]145[/TD]
[TD="align: right"]217[/TD]
[TD="align: right"]308[/TD]
[TD="align: right"]392[/TD]
[TD="align: right"]159[/TD]
[TD="align: right"]347[/TD]
[TD="align: right"]41[/TD]
[TD="align: right"]485[/TD]
[TD="align: right"]299[/TD]
[/TR]
[TR]
[TD]Bahamas[/TD]
[TD="align: right"]2681[/TD]
[TD="align: right"]308[/TD]
[TD="align: right"]97[/TD]
[TD="align: right"]285[/TD]
[TD="align: right"]232[/TD]
[TD="align: right"]382[/TD]
[TD="align: right"]99[/TD]
[TD="align: right"]128[/TD]
[TD="align: right"]94[/TD]
[TD="align: right"]57[/TD]
[TD="align: right"]451[/TD]
[TD="align: right"]64[/TD]
[/TR]
[TR]
[TD]Bahrain[/TD]
[TD="align: right"]4450[/TD]
[TD="align: right"]294[/TD]
[TD="align: right"]285[/TD]
[TD="align: right"]257[/TD]
[TD="align: right"]403[/TD]
[TD="align: right"]438[/TD]
[TD="align: right"]140[/TD]
[TD="align: right"]104[/TD]
[TD="align: right"]402[/TD]
[TD="align: right"]21[/TD]
[TD="align: right"]308[/TD]
[TD="align: right"]208[/TD]
[/TR]
[TR]
[TD]Bangladesh[/TD]
[TD="align: right"]516[/TD]
[TD="align: right"]316[/TD]
[TD="align: right"]362[/TD]
[TD="align: right"]323[/TD]
[TD="align: right"]328[/TD]
[TD="align: right"]220[/TD]
[TD="align: right"]252[/TD]
[TD="align: right"]27[/TD]
[TD="align: right"]371[/TD]
[TD="align: right"]48[/TD]
[TD="align: right"]20[/TD]
[TD="align: right"]148[/TD]
[/TR]
[TR]
[TD]Barbados[/TD]
[TD="align: right"]1047[/TD]
[TD="align: right"]146[/TD]
[TD="align: right"]30[/TD]
[TD="align: right"]487[/TD]
[TD="align: right"]275[/TD]
[TD="align: right"]35[/TD]
[TD="align: right"]9[/TD]
[TD="align: right"]472[/TD]
[TD="align: right"]363[/TD]
[TD="align: right"]44[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]253[/TD]
[/TR]
[TR]
[TD]Belarus[/TD]
[TD="align: right"]4249[/TD]
[TD="align: right"]462[/TD]
[TD="align: right"]436[/TD]
[TD="align: right"]244[/TD]
[TD="align: right"]428[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]449[/TD]
[TD="align: right"]318[/TD]
[TD="align: right"]460[/TD]
[TD="align: right"]113[/TD]
[TD="align: right"]39[/TD]
[TD="align: right"]191[/TD]
[/TR]
[TR]
[TD]Belgium[/TD]
[TD="align: right"]4547[/TD]
[TD="align: right"]190[/TD]
[TD="align: right"]63[/TD]
[TD="align: right"]37[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]323[/TD]
[TD="align: right"]287[/TD]
[TD="align: right"]304[/TD]
[TD="align: right"]487[/TD]
[TD="align: right"]22[/TD]
[TD="align: right"]74[/TD]
[TD="align: right"]374[/TD]
[/TR]
[TR]
[TD]Belgium-Luxem.[/TD]
[TD="align: right"]883[/TD]
[TD="align: right"]374[/TD]
[TD="align: right"]375[/TD]
[TD="align: right"]424[/TD]
[TD="align: right"]137[/TD]
[TD="align: right"]334[/TD]
[TD="align: right"]146[/TD]
[TD="align: right"]184[/TD]
[TD="align: right"]350[/TD]
[TD="align: right"]443[/TD]
[TD="align: right"]430[/TD]
[TD="align: right"]324[/TD]
[/TR]
</tbody>[/TABLE]



Sheet2

[TABLE="width: 819"]
<colgroup><col><col><col><col><col><col span="2"><col><col></colgroup><tbody>[TR]
[TD]Countries[/TD]
[TD]Jan-Feb 2013[/TD]
[TD]Jan-Mar 2013[/TD]
[TD]Apr-May 2013[/TD]
[TD]Mar-Jul 2013[/TD]
[TD]Jan-Aug 2013[/TD]
[TD]Sep-Oct 2013[/TD]
[TD]Aug-Nov 2013[/TD]
[TD]Sep-Dec 2013[/TD]
[/TR]
[TR]
[TD]Abu Dhabi[/TD]
[TD="align: right"]3046[/TD]
[TD="align: right"]3380[/TD]
[TD="align: right"]238[/TD]
[TD="align: right"]949[/TD]
[TD="align: right"]4209[/TD]
[TD="align: right"]280[/TD]
[TD="align: right"]539[/TD]
[TD="align: right"]345[/TD]
[/TR]
[TR]
[TD]Afghanistan[/TD]
[TD="align: right"]2631[/TD]
[TD="align: right"]2709[/TD]
[TD="align: right"]555[/TD]
[TD="align: right"]1282[/TD]
[TD="align: right"]4303[/TD]
[TD="align: right"]480[/TD]
[TD="align: right"]1313[/TD]
[TD="align: right"]1160[/TD]
[/TR]
[TR]
[TD]Albania[/TD]
[TD="align: right"]925[/TD]
[TD="align: right"]1101[/TD]
[TD="align: right"]390[/TD]
[TD="align: right"]906[/TD]
[TD="align: right"]1886[/TD]
[TD="align: right"]654[/TD]
[TD="align: right"]1076[/TD]
[TD="align: right"]1292[/TD]
[/TR]
[TR]
[TD]Algeria[/TD]
[TD="align: right"]2267[/TD]
[TD="align: right"]2320[/TD]
[TD="align: right"]228[/TD]
[TD="align: right"]971[/TD]
[TD="align: right"]3362[/TD]
[TD="align: right"]553[/TD]
[TD="align: right"]987[/TD]
[TD="align: right"]921[/TD]
[/TR]
[TR]
[TD]American Samoa[/TD]
[TD="align: right"]1387[/TD]
[TD="align: right"]1801[/TD]
[TD="align: right"]829[/TD]
[TD="align: right"]1638[/TD]
[TD="align: right"]3325[/TD]
[TD="align: right"]316[/TD]
[TD="align: right"]692[/TD]
[TD="align: right"]836[/TD]
[/TR]
[TR]
[TD]Andorra[/TD]
[TD="align: right"]619[/TD]
[TD="align: right"]698[/TD]
[TD="align: right"]449[/TD]
[TD="align: right"]1221[/TD]
[TD="align: right"]2332[/TD]
[TD="align: right"]915[/TD]
[TD="align: right"]1747[/TD]
[TD="align: right"]1486[/TD]
[/TR]
[TR]
[TD]Angola[/TD]
[TD="align: right"]1517[/TD]
[TD="align: right"]1934[/TD]
[TD="align: right"]556[/TD]
[TD="align: right"]1375[/TD]
[TD="align: right"]3374[/TD]
[TD="align: right"]910[/TD]
[TD="align: right"]1790[/TD]
[TD="align: right"]1468[/TD]
[/TR]
[TR]
[TD]Anguilla[/TD]
[TD="align: right"]2783[/TD]
[TD="align: right"]3132[/TD]
[TD="align: right"]737[/TD]
[TD="align: right"]1392[/TD]
[TD="align: right"]4533[/TD]
[TD="align: right"]189[/TD]
[TD="align: right"]945[/TD]
[TD="align: right"]689[/TD]
[/TR]
[TR]
[TD]Antarctica[/TD]
[TD="align: right"]5151[/TD]
[TD="align: right"]5363[/TD]
[TD="align: right"]486[/TD]
[TD="align: right"]1121[/TD]
[TD="align: right"]6431[/TD]
[TD="align: right"]409[/TD]
[TD="align: right"]683[/TD]
[TD="align: right"]860[/TD]
[/TR]
[TR]
[TD]Antigua:Barbuda[/TD]
[TD="align: right"]205[/TD]
[TD="align: right"]344[/TD]
[TD="align: right"]339[/TD]
[TD="align: right"]802[/TD]
[TD="align: right"]1463[/TD]
[TD="align: right"]368[/TD]
[TD="align: right"]1001[/TD]
[TD="align: right"]1007[/TD]
[/TR]
[TR]
[TD]Argentina[/TD]
[TD="align: right"]2076[/TD]
[TD="align: right"]2429[/TD]
[TD="align: right"]140[/TD]
[TD="align: right"]1066[/TD]
[TD="align: right"]3280[/TD]
[TD="align: right"]209[/TD]
[TD="align: right"]778[/TD]
[TD="align: right"]1007[/TD]
[/TR]
[TR]
[TD]Armenia[/TD]
[TD="align: right"]3410[/TD]
[TD="align: right"]3828[/TD]
[TD="align: right"]760[/TD]
[TD="align: right"]1723[/TD]
[TD="align: right"]5402[/TD]
[TD="align: right"]555[/TD]
[TD="align: right"]1002[/TD]
[TD="align: right"]748[/TD]
[/TR]
[TR]
[TD]Aruba[/TD]
[TD="align: right"]4296[/TD]
[TD="align: right"]4774[/TD]
[TD="align: right"]475[/TD]
[TD="align: right"]1450[/TD]
[TD="align: right"]5816[/TD]
[TD="align: right"]806[/TD]
[TD="align: right"]1257[/TD]
[TD="align: right"]1308[/TD]
[/TR]
[TR]
[TD]Austral Oceania[/TD]
[TD="align: right"]3535[/TD]
[TD="align: right"]3726[/TD]
[TD="align: right"]425[/TD]
[TD="align: right"]1247[/TD]
[TD="align: right"]5109[/TD]
[TD="align: right"]350[/TD]
[TD="align: right"]835[/TD]
[TD="align: right"]664[/TD]
[/TR]
[TR]
[TD]Australia[/TD]
[TD="align: right"]5187[/TD]
[TD="align: right"]5342[/TD]
[TD="align: right"]337[/TD]
[TD="align: right"]1064[/TD]
[TD="align: right"]6713[/TD]
[TD="align: right"]579[/TD]
[TD="align: right"]1487[/TD]
[TD="align: right"]1174[/TD]
[/TR]
[TR]
[TD]Austria[/TD]
[TD="align: right"]2384[/TD]
[TD="align: right"]2592[/TD]
[TD="align: right"]709[/TD]
[TD="align: right"]1468[/TD]
[TD="align: right"]4107[/TD]
[TD="align: right"]267[/TD]
[TD="align: right"]698[/TD]
[TD="align: right"]760[/TD]
[/TR]
[TR]
[TD]Azerbaijan[/TD]
[TD="align: right"]5326[/TD]
[TD="align: right"]5736[/TD]
[TD="align: right"]362[/TD]
[TD="align: right"]1472[/TD]
[TD="align: right"]6957[/TD]
[TD="align: right"]388[/TD]
[TD="align: right"]1032[/TD]
[TD="align: right"]1172[/TD]
[/TR]
[TR]
[TD]Bahamas[/TD]
[TD="align: right"]2989[/TD]
[TD="align: right"]3086[/TD]
[TD="align: right"]517[/TD]
[TD="align: right"]1095[/TD]
[TD="align: right"]4212[/TD]
[TD="align: right"]151[/TD]
[TD="align: right"]730[/TD]
[TD="align: right"]666[/TD]
[/TR]
[TR]
[TD]Bahrain[/TD]
[TD="align: right"]4744[/TD]
[TD="align: right"]5029[/TD]
[TD="align: right"]660[/TD]
[TD="align: right"]1523[/TD]
[TD="align: right"]6371[/TD]
[TD="align: right"]423[/TD]
[TD="align: right"]835[/TD]
[TD="align: right"]939[/TD]
[/TR]
[TR]
[TD]Bangladesh[/TD]
[TD="align: right"]832[/TD]
[TD="align: right"]1194[/TD]
[TD="align: right"]651[/TD]
[TD="align: right"]1485[/TD]
[TD="align: right"]2344[/TD]
[TD="align: right"]419[/TD]
[TD="align: right"]466[/TD]
[TD="align: right"]587[/TD]
[/TR]
[TR]
[TD]Barbados[/TD]
[TD="align: right"]1193[/TD]
[TD="align: right"]1223[/TD]
[TD="align: right"]762[/TD]
[TD="align: right"]836[/TD]
[TD="align: right"]2501[/TD]
[TD="align: right"]407[/TD]
[TD="align: right"]883[/TD]
[TD="align: right"]664[/TD]
[/TR]
[TR]
[TD]Belarus[/TD]
[TD="align: right"]4711[/TD]
[TD="align: right"]5147[/TD]
[TD="align: right"]672[/TD]
[TD="align: right"]1595[/TD]
[TD="align: right"]6624[/TD]
[TD="align: right"]573[/TD]
[TD="align: right"]930[/TD]
[TD="align: right"]803[/TD]
[/TR]
[TR]
[TD]Belgium[/TD]
[TD="align: right"]4737[/TD]
[TD="align: right"]4800[/TD]
[TD="align: right"]43[/TD]
[TD="align: right"]716[/TD]
[TD="align: right"]5757[/TD]
[TD="align: right"]509[/TD]
[TD="align: right"]887[/TD]
[TD="align: right"]957[/TD]
[/TR]
[TR]
[TD]Belgium-Luxem.[/TD]
[TD="align: right"]1257[/TD]
[TD="align: right"]1632[/TD]
[TD="align: right"]561[/TD]
[TD="align: right"]1416[/TD]
[TD="align: right"]2857[/TD]
[TD="align: right"]793[/TD]
[TD="align: right"]1407[/TD]
[TD="align: right"]1547[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
Reply to Post #13

I'd suggest splitting the header row in two rows on Sheet2 like this:

B1: 1-Jan-2013
B2: 1-Feb-2013

C1: 1-Jan-2013
C2: 1-Mar-2013

and so on.

Now we can have...

Sheet2, B3...

Control+shift+enter, copy across, and down.
Rich (BB code):
=SUM(IF(Sheet1!$A$2:$A$100=$A3,IF(Sheet1!$B$1:$M$1>=B$1,
    IF(Sheet1!$B$1:$M$1<=B$2,Sheet1!$B$2:$M$100))))

The foregoing would be a much better approach than doing text operations on the header entries on Sheet2.
 
Upvote 0
Many thanks Aladin. The problem is that the headers in sheet2 aren't for two months what if I have eight months like in sheer2 header F1
It is from jan to aug . In this case do I need to split it in 8 rows?

Thanks again
 
Upvote 0
Many thanks Aladin. The problem is that the headers in sheet2 aren't for two months what if I have eight months like in sheer2 header F1
It is from jan to aug . In this case do I need to split it in 8 rows?

Thanks again

You got me wrong...

Each From is in the first row and corresponding To immediately underneath in the second row... Thus:

F1: 1-Jan-2013
F2: 1-Aug-2013

The suggested formula reads these two as From-To.
 
Upvote 0
Reply to Post #13

I'd suggest splitting the header row in two rows on Sheet2 like this:

B1: 1-Jan-2013
B2: 1-Feb-2013

C1: 1-Jan-2013
C2: 1-Mar-2013

and so on.

Now we can have...

Sheet2, B3...

Control+shift+enter, copy across, and down.
Rich (BB code):
=SUM(IF(Sheet1!$A$2:$A$100=$A3,IF(Sheet1!$B$1:$M$1>=B$1,
    IF(Sheet1!$B$1:$M$1<=B$2,Sheet1!$B$2:$M$100))))

The foregoing would be a much better approach than doing text operations on the header entries on Sheet2.

Many thanks Aladin. The problem is that the headers in sheet2 aren't for two months what if I have eight months like in sheer2 header F1
It is from jan to aug . In this case do I need to split it in 8 rows?

Thanks again

You got me wrong...

Each From is in the first row and corresponding To immediately underneath in the second row... Thus:

F1: 1-Jan-2013
F2: 1-Aug-2013

The suggested formula reads these two as From-To.

See:

https://dl.dropboxusercontent.com/u/65698317/Sum%2BIf%20from-to%20jamilm.xlsx
 
Upvote 0
Upvote 0
Thank you very much Aladin. this works. however, i have a problem where my Data in source sheet cannot always be in the same order.

for example in the sheet2 i switched Country names between Abu Dhabi and Afghanistan and then the formula value changed.

plz see https://www.dropbox.com/s/5755pbwx8lkf0zo/Sum+If from-to jamilm.xlsx

Try this small modification in Aladin's formula:

Control+Shift+Enter

Code:
=SUM(IF(Sheet1!$A$[COLOR="#FF0000"]1[/COLOR]:$A$100=$A3,IF(Sheet1!$[COLOR="#FF0000"]A[/COLOR]$1:$M$1 >= B$1,
IF(Sheet1!$[COLOR="#FF0000"]A[/COLOR]$1:$M$1<=B$2,Sheet1!$[COLOR="#FF0000"]A[/COLOR]$[COLOR="#FF0000"]1[/COLOR]:$M$100))))


Markmzz
 
Upvote 0
I am sorry, i made a mistake in entering the formula before. becuase when i rechecked even previous Formula provided by Aladin's was working perfectly.

Thank you very much Aladin and Markmzz.
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,875
Members
452,363
Latest member
merico17

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