Forum Discussion

deniztopcu's avatar
deniztopcu
Brass Contributor
Oct 21, 2024

Converting Periodic Data to Quarterly Data

hi,

As seen in the attached example file, I obtain quarterly data in the range "C179:T214" by manually processing the periodic data in the range "AA179:AV214".
Quarterly data is obtained as follows: "IF(RIGHT(Quarter date; 1) = "3"; write as is; otherwise subtract from previous)"

Quarterly Data:
1- array formula to do the entire row at once.

2- Using an array formula for the entire block.

 

 

  2024/62024/32023/122023/92023/62023/32022/122022/92022/62022/32021/122021/92021/62021/32020/122020/92020/62020/32019/12                           
 USD           32,83               32,29               29,44             27,38               25,82               19,15               18,70             18,52             16,66             14,64             13,33               8,88               8,68               8,33               7,42               7,75               6,84               6,57               5,94               6           6                         
                                                
                                                
1000                        4                       5                       6                    7                       8                       9                    10                  11                  12                  13                  14                  15                  16                  17                  18                  19                  20                  21                  22                           
                                                
                                                
                                                
                                                
                        Dönemlik Finansal TabloitemDescEng2024/62024/32023/122023/92023/62023/32022/122022/92022/62022/32021/122021/92021/62021/32020/122020/92020/62020/32019/122019/92019/62019/6
3BSürdürülen Faaliyetler                     -                       -                       -                     -                       -                       -                       -                     -                     -                     -                     -                     -                     -                     -                     -                     -                     -                     -       3B  Sürdürülen Faaliyetler  Continuing Operations                               -                                -                                -                                -                                -                             -                                -                                -                             -                             -                             -                             -                             -                             -                             -                             -                             -                             -                             -                             -                             -                           -  
3CSatış Gelirleri       3.328.221       3.484.238       4.919.580-      509.910       3.930.608       5.016.264       9.446.445    2.223.218    2.048.771    1.866.076    1.543.730    1.966.237    1.977.264    1.861.881    2.063.393    1.749.195    2.049.991    1.917.562     3C  Satış Gelirleri  Net Sales   221.742.860.000  112.490.019.000  328.441.924.000  183.618.341.000  197.577.993.000  96.077.514.000  279.252.910.000  102.620.448.000  61.449.339.000  27.313.940.000  70.698.507.000  50.122.131.000  32.664.892.000  15.501.646.000  55.495.364.000  40.186.226.000  26.626.115.000  12.597.616.000  40.211.942.000  29.683.016.000  19.270.728.000  9.025.282.000
3CASatışların Maliyeti (-)-     2.770.361-     2.884.688-     4.369.355        690.205-     3.314.184-     4.252.363-     8.185.675-   1.830.365-   1.679.443-   1.519.856-   1.235.962-   1.596.628-   1.605.969-   1.519.180-   1.677.107-   1.425.250-   1.673.784-   1.587.612      3CA  Satışların Maliyeti (-)  Cost Of Sales - 184.073.751.000-   93.133.311.000- 276.759.269.000- 148.133.330.000- 167.028.867.000- 81.446.368.000- 237.182.345.000-   84.124.131.000- 50.228.152.000- 22.246.287.000- 57.238.477.000- 40.764.341.000- 26.588.682.000- 12.648.389.000- 45.375.969.000- 32.932.838.000- 21.884.018.000- 10.429.978.000- 33.226.484.000- 24.493.133.000- 15.928.955.000- 7.488.411.000
3CAATicari Faaliyetlerden Diğer Kar (Zarar)                     -                       -                       -                     -                       -                       -                       -                     -                     -                     -                     -                     -                     -                     -                     -                     -                     -                     -       3CAA  Ticari Faaliyetlerden Diğer Kar (Zarar)  Other Profit (Loss) from Trade Operations                               -                                -                                -                                -                                -                             -                                -                                -                             -                             -                             -                             -                             -                             -                             -                             -                             -                             -                             -                             -                             -                           -  
3CABTicari Faaliyetlerden Brüt Kar (Zarar)          557.859          599.550          550.225        180.295          616.424          763.901       1.260.770        392.853        369.329        346.220        307.768        369.610        371.295        342.701        386.286        323.946        376.207        329.950     3CAB  Ticari Faaliyetlerden Brüt Kar (Zarar)  Gross Profit (Loss) from Trade Operations      37.669.109.000     19.356.708.000     51.682.655.000     35.485.011.000     30.549.126.000  14.631.146.000     42.070.565.000     18.496.317.000  11.221.187.000     5.067.653.000  13.460.030.000     9.357.790.000     6.076.210.000     2.853.257.000  10.119.395.000     7.253.388.000     4.742.097.000     2.167.638.000     6.985.458.000     5.189.883.000     3.341.773.000  1.536.871.000
3CACFaiz, Ücret, Prim, Komisyon ve Diğer Gelirler                     -                       -                       -                     -                       -                       -                       -                     -                     -                     -                     -                     -                     -                     -                     -                     -                     -                     -       3CAC  Faiz, Ücret, Prim, Komisyon ve Diğer Gelirler  Proceeds from Interest, Fee, Premium, Commission and Other                               -                                -                                -                                -                                -                             -                                -                                -                             -                             -                             -                             -                             -                             -                             -                             -                             -                             -                             -                             -                             -                           -  
3CADFaiz, Ücret, Prim, Komisyon ve Diğer Giderler (-)                     -                       -                       -                     -                       -                       -                       -                     -                     -                     -                     -                     -                     -                     -                     -                     -                     -                     -       3CAD  Faiz, Ücret, Prim, Komisyon ve Diğer Giderler (-)  Expenses from Interest, Fee, Premium, Commission and Other                               -                                -                                -                                -                                -                             -                                -                                -                             -                             -                             -                             -                             -                             -                             -                             -                             -                             -                             -                             -                             -                           -  
3CAEFinans Sektörü Faaliyetlerinden Diğer Kar (Zarar)                     -                       -                       -                     -                       -                       -                       -                     -                     -                     -                     -                     -                     -                     -                     -                     -                     -                     -       3CAE  Finans Sektörü Faaliyetlerinden Diğer Kar (Zarar)  Other Profit (Loss) from Financial Operations                               -                                -                                -                                -                                -                             -                                -                                -                             -                             -                             -                             -                             -                             -                             -                             -                             -                             -                             -                             -                             -                           -  
3CAFFinans Sektörü Faaliyetlerinden Brüt Kar (Zarar)                     -                       -                       -                     -                       -                       -                       -                     -                     -                     -                     -                     -                     -                     -                     -                     -                     -                     -       3CAF  Finans Sektörü Faaliyetlerinden Brüt Kar (Zarar)  Gross Profit (Loss) from Financial Operations                               -                                -                                -                                -                                -                             -                                -                                -                             -                             -                             -                             -                             -                             -                             -                             -                             -                             -                             -                             -                             -                           -  
3CBDiğer Gelir ve Giderler                     -                       -                       -                     -                       -                       -                       -                     -                     -                     -                     -                     -                     -                     -                     -                     -                     -                     -       3CB  Diğer Gelir ve Giderler  Other Income (Expenses)                               -                                -                                -                                -                                -                             -                                -                                -                             -                             -                             -                             -                             -                             -                             -                             -                             -                             -                             -                             -                             -                           -  
3DBRÜT KAR (ZARAR)          557.859          599.550          550.225        180.295          616.424          763.901       1.260.770        392.853        369.329        346.220        307.768        369.610        371.295        342.701        386.286        323.946        376.207        329.950     3D  BRÜT KAR (ZARAR)  GROSS PROFIT (LOSS)      37.669.109.000     19.356.708.000     51.682.655.000     35.485.011.000     30.549.126.000  14.631.146.000     42.070.565.000     18.496.317.000  11.221.187.000     5.067.653.000  13.460.030.000     9.357.790.000     6.076.210.000     2.853.257.000  10.119.395.000     7.253.388.000     4.742.097.000     2.167.638.000     6.985.458.000     5.189.883.000     3.341.773.000  1.536.871.000
3DAPazarlama, Satış ve Dağıtım Giderleri (-)-         487.773-         483.917-         704.942        154.453-         505.536-         659.724-     1.163.325-      242.820-      210.246-      199.556-      161.434-      219.372-      218.755-      203.668-      197.798-      188.778-      202.236-      196.890     3DA  Pazarlama, Satış ve Dağıtım Giderleri (-)  Marketing Selling & Distrib. Expenses (-) -   31.635.210.000-   15.623.469.000-   42.214.147.000-   21.461.916.000-   25.690.330.000- 12.635.826.000-   32.672.797.000-   10.920.605.000-   6.423.903.000-   2.920.915.000-   7.694.012.000-   5.542.256.000-   3.594.560.000-   1.695.699.000-   5.608.409.000-   4.140.870.000-   2.677.427.000-   1.293.486.000-   4.278.730.000-   3.171.389.000-   2.049.581.000-    977.311.000
3DBGenel Yönetim Giderleri (-)-           70.410-           76.151-           99.853          24.003-           77.440-           95.420-         134.132-         29.317-         26.277-         27.226-         16.775-         30.566-         29.549-         28.951-         30.703-         24.458-         27.481-         31.754     3DB  Genel Yönetim Giderleri (-)  General Administrative Expenses (-) -     4.769.889.000-     2.458.581.000-     6.109.712.000-     3.170.224.000-     3.827.341.000-   1.827.600.000-     3.887.274.000-     1.379.235.000-       836.329.000-       398.514.000-       992.509.000-       768.912.000-       497.533.000-       241.041.000-       814.075.000-       586.276.000-       396.669.000-       208.609.000-       640.439.000-       471.751.000-       314.712.000-    157.070.000
3DCAraştırma ve Geliştirme Giderleri (-)                     -                       -                       -                     -                       -                       -                       -                     -                     -                     -                     -                     -                     -                     -                     -                     -                     -                     -       3DC  Araştırma ve Geliştirme Giderleri (-)  Research & Development Expenses (-)                               -                                -                                -                                -                                -                             -                                -                                -                             -                             -                             -                             -                             -                             -                             -                             -                             -                             -                             -                             -                             -                           -  
3DDDiğer Faaliyet Gelirleri               7.108               8.144            23.754-           3.008            28.760               7.698            21.336            4.902            5.575            4.755            2.768            4.418            3.995            4.246            4.592            4.847            2.737            2.848     3DD  Diğer Faaliyet Gelirleri  Income from Other Operations           496.274.000          262.930.000       1.507.063.000          807.775.000          890.114.000        147.439.000          652.216.000          253.263.000        162.492.000          69.601.000        146.143.000        109.250.000          70.023.000          35.349.000        109.085.000          75.013.000          37.437.000          18.707.000          73.808.000          44.729.000          28.648.000        12.818.000
3DEDiğer Faaliyet Giderleri (-)-             2.479-             7.305-           19.293            2.946-             4.427-           15.880-           15.184-           1.279-           2.310-           1.031-         58.695-              719-              476-              421-           1.064-              999-              242-              479     3DE  Diğer Faaliyet Giderleri (-)  Expenses from Other Operations (-) -         317.226.000-         235.856.000-         905.780.000-         337.823.000-         418.488.000-       304.157.000-         361.172.000-           77.266.000-         53.572.000-         15.088.000-       796.370.000-         14.022.000-           7.639.000-           3.508.000-         20.440.000-         12.543.000-           4.798.000-           3.144.000-         18.034.000-         12.062.000-           8.755.000-         3.743.000
3DEAFaaliyet Karı Öncesi Diğer Gelir ve Giderler                     -                       -                       -                     -                       -                       -                       -                     -                     -                     -                     -                     -                     -                     -                     -                     -                     -                     -       3DEA  Faaliyet Karı Öncesi Diğer Gelir ve Giderler  Other Income (Expenses) Before Operating Profits                               -                                -                                -                                -                                -                             -                                -                                -                             -                             -                             -                             -                             -                             -                             -                             -                             -                             -                             -                             -                             -                           -  
3DFFAALİYET KARI (ZARARI)               4.305            40.320-         250.108        358.690            57.781                  574-           30.534        124.339        136.071        123.162          73.631        123.371        126.510        113.906        161.313        114.557        148.985        103.675     3DF  FAALİYET KARI (ZARARI)  OPERATING PROFITS        1.443.058.000       1.301.732.000       3.960.079.000     11.322.823.000       1.503.081.000          11.002.000       5.801.538.000       6.372.474.000     4.069.875.000     1.802.737.000     4.123.282.000     3.141.850.000     2.046.501.000        948.358.000     3.785.556.000     2.588.712.000     1.700.640.000        681.106.000     2.122.063.000     1.579.410.000        997.373.000      411.565.000
3HNet Faaliyet Kar/Zararı-                 324            39.481-         254.570        358.751            33.448               8.757-           36.687        120.717        132.806        119.438        129.559        119.672        122.991        110.082        157.785        110.709        146.490        101.306     3H  Net Faaliyet Kar/Zararı  Net Operating Profits        1.264.010.000       1.274.658.000       3.358.796.000     10.852.871.000       1.031.455.000        167.720.000       5.510.494.000       6.196.477.000     3.960.955.000     1.748.224.000     4.773.509.000     3.046.622.000     1.984.117.000        916.517.000     3.696.911.000     2.526.242.000     1.668.001.000        665.543.000     2.066.289.000     1.546.743.000        977.480.000      402.490.000
3HA  Yatırım Faaliyetlerinden Gelirler            24.093            15.764            25.275            4.923               5.958               6.534            22.834            6.031            8.902            2.961            6.688            8.237          10.856            9.300          11.356            3.585            2.056            1.971     3HA    Yatırım Faaliyetlerinden Gelirler                                                                                                                            -         1.299.814.000          508.942.000       1.157.821.000          413.772.000          278.988.000        125.146.000          730.315.000          303.353.000        191.669.000          43.347.000        333.931.000        244.791.000        171.660.000          77.430.000        139.056.000          54.804.000          27.014.000          12.947.000        115.150.000          73.049.000          44.323.000        20.272.000
3HAA  Yatırım Faaliyetlerinden Giderler (-)                     -  -                 936-             9.458                124                    86-             1.913                     -                     -                  241-              274                  46                184-                 42-              226-              235-              153-              163-              185     3HAA    Yatırım Faaliyetlerinden Giderler (-)                                                                                                                            -  -           30.233.000-           30.233.000-         309.458.000-           31.027.000-           34.424.000-         36.643.000                              -                                -                             -  -           4.013.000                           -  -               608.000-           2.242.000-           1.878.000-           5.266.000-           3.519.000-           2.331.000-           1.215.000-           3.423.000-           2.675.000-                 99.000-               99.000
3HAB  Diğer Gelir ve Giderler                     -                       -                       -                     -                       -                       -                       -                     -                     -                     -                     -                     -                     -                     -                     -                     -                     -                     -       3HAB    Diğer Gelir ve Giderler                                                                                                                            -                                -                                -                                -                                -                                -                             -                                -                                -                             -                             -                             -                             -                             -                             -                             -                             -                             -                             -                             -                             -                             -                           -  
3HACÖzkaynak Yöntemiyle Değerlenen Yatırımların Kar/Zararlarındaki Paylar                     -                       -                       -                     -                       -                       -                       -                     -                     -                     -                     -                     -                     -                     -                     -                     -                     -                     -       3HAC  Özkaynak Yöntemiyle Değerlenen Yatırımların Kar/Zararlarındaki Paylar  Profit (Loss) from Subsidiaries                               -                                -                                -                                -                                -                             -                                -                                -                             -                             -                             -                             -                             -                             -                             -                             -                             -                             -                             -                             -                             -                           -  
3HACAFinansman Gideri Öncesi Faaliyet Karı/Zararı            28.398            55.147-         234.292        363.737            63.824               5.195-             7.700        130.370        145.214        125.849          80.365        131.792        137.323        122.980        172.433        117.989        150.878        105.461     3HACA  Finansman Gideri Öncesi Faaliyet Karı/Zararı                                                                                                                            -         2.712.639.000       1.780.441.000       4.808.442.000     11.705.568.000       1.747.645.000          99.505.000       6.531.853.000       6.675.827.000     4.261.544.000     1.842.071.000     4.457.213.000     3.386.033.000     2.215.919.000     1.023.910.000     3.919.346.000     2.639.997.000     1.725.323.000        692.838.000     2.233.790.000     1.649.784.000     1.041.597.000      431.738.000
3HB(Esas Faaliyet Dışı) Finansal Gelirler               1.351                  804               7.408-           2.756               8.358               1.906            13.591            3.300            2.089            5.738          21.704            8.659            6.720            3.410            5.802          14.247            9.870            6.040     3HB  (Esas Faaliyet Dışı) Finansal Gelirler  Financial Income (from Other Operations)              70.305.000             25.966.000          394.967.000          176.890.000          252.346.000          36.512.000          434.042.000          179.911.000        118.794.000          83.981.000        452.892.000        163.600.000          86.718.000          28.389.000        260.721.000        217.670.000        107.222.000          39.680.000          20.623.000          13.237.000             5.901.000          1.864.000
3HC(Esas Faaliyet Dışı) Finansal Giderler (-)          101.396          159.772          624.886-      330.755          127.421          219.821          709.020-         17.821-         18.115-         20.392-         24.160-         28.670-         25.021-         24.828-         35.046-         23.963-         29.858-         27.140     3HC  (Esas Faaliyet Dışı) Finansal Giderler (-)  Financial Expenses (from Other Operations) (-)        8.486.749.000       5.158.310.000     16.841.203.000-     1.554.305.000       7.500.678.000     4.210.280.000     12.327.137.000-         930.333.000-       600.305.000-       298.479.000-   1.000.480.000-       678.447.000-       423.899.000-       206.709.000-       828.409.000-       568.387.000-       382.623.000-       178.301.000-       663.539.000-       484.643.000-       316.899.000-    154.144.000
3HCAVergi Öncesi Diğer Gelir ve Giderler            24.093            14.827            15.817            5.047               6.043               4.621            22.834            6.031            9.143            2.687            6.733            8.421          10.814            9.074          11.120            3.432            1.893            1.786     3HCA  Vergi Öncesi Diğer Gelir ve Giderler  Other Income (Expenses) Before Tax        1.269.581.000          478.709.000          848.363.000          382.745.000          244.564.000          88.503.000          730.315.000          303.353.000        191.669.000          39.334.000        333.931.000        244.183.000        169.418.000          75.552.000        133.790.000          51.285.000          24.683.000          11.732.000        111.727.000          70.374.000          44.224.000        20.173.000
3ISÜRDÜRÜLEN FAALİYETLER VERGİ ÖNCESİ KARI (ZARARI)          131.145          215.723          398.002          30.226          199.603          226.923          714.911        115.849        129.188        111.195          77.908        111.781        119.022        101.563        143.189        108.274        130.890          84.361     3I  SÜRDÜRÜLEN FAALİYETLER VERGİ ÖNCESİ KARI (ZARARI)  PROFIT BEFORE TAX FROM CONTINUING OPERATIONS       11.269.693.000       6.964.717.000     22.044.612.000     10.328.153.000       9.500.669.000     4.346.297.000     19.293.032.000       5.925.405.000     3.780.033.000     1.627.573.000     3.909.625.000     2.871.186.000     1.878.738.000        845.590.000     3.351.658.000     2.289.280.000     1.449.922.000        554.217.000     1.590.874.000     1.178.378.000        730.599.000      279.458.000
3IASürdürülen Faaliyetler Vergi Geliri (Gideri)               6.667-           85.502-         146.550          72.431-           45.398-         161.630-           84.150-         19.859-         28.150-         19.359-         29.734-         11.274-         34.731-         19.340-         31.965-         23.940-         28.977-         18.845     3IA  Sürdürülen Faaliyetler Vergi Geliri (Gideri)  Taxation on Continuing Operations -     2.541.616.000-     2.760.459.000-     6.599.323.000-     2.285.145.000-     4.268.055.000-   3.095.739.000-     2.693.600.000-     1.120.139.000-       752.381.000-       283.362.000-       958.915.000-       562.594.000-       462.495.000-       161.023.000-       744.843.000-       507.684.000-       322.100.000-       123.806.000-       365.997.000-       272.163.000-       168.303.000-       64.074.000
3IB  Dönem Vergi Geliri (Gideri)-           27.393-           37.348-           68.060-         23.097-           32.016-           34.413-           92.341-         18.616-         26.767-         21.377-         33.069-         25.886-         38.113-         23.759-         31.716-         24.648-         31.621-         24.119     3IB    Dönem Vergi Geliri (Gideri)    Taxation on Income (Expenses) -     2.104.975.000-     1.205.782.000-     4.121.772.000-     2.118.201.000-     1.485.870.000-       659.119.000-     2.830.225.000-     1.103.606.000-       758.865.000-       312.897.000-   1.199.244.000-       758.470.000-       528.644.000-       197.810.000-       801.238.000-       565.926.000-       374.847.000-       158.455.000-       424.831.000-       331.485.000-       197.742.000-       78.711.000
3IC  Ertelenmiş Vergi Geliri (Gideri)            34.059-           48.154-           78.490          95.528-           13.382-         127.217               8.191-           1.243-           1.383            2.018            3.335          14.611            3.383            4.418-              249                709            2.645            5.274     3IC    Ertelenmiş Vergi Geliri (Gideri)    Income (Expenses) of Deferred Tax -         436.641.000-     1.554.677.000-     2.477.551.000-         166.944.000-     2.782.185.000-   2.436.620.000          136.625.000-           16.533.000             6.484.000          29.535.000        240.329.000        195.876.000          66.149.000          36.787.000          56.395.000          58.242.000          52.747.000          34.649.000          58.834.000          59.322.000          29.439.000        14.637.000
3ID  Diğer Vergi Geliri (Gideri)                     -                       -                       -                     -                       -                       -                       -                     -                     -                     -                     -                     -                     -                     -                     -                     -                     -                     -       3ID    Diğer Vergi Geliri (Gideri)    Other Taxation Income (Expenses)                               -                                -                                -                                -                                -                             -                                -                                -                             -                             -                             -                             -                             -                             -                             -                             -                             -                             -                             -                             -                             -                           -  
3JSÜRDÜRÜLEN FAALİYETLER DÖNEM KARI/ZARARI          137.811          130.222          251.452        102.656          154.205            65.292          630.761          95.990        101.038          91.836          48.175        100.507          84.292          82.222        111.224          84.334        101.913          65.516     3J  SÜRDÜRÜLEN FAALİYETLER DÖNEM KARI/ZARARI  PROFIT FROM CONTINUING OPERATIONS         8.728.077.000       4.204.258.000     15.445.289.000       8.043.008.000       5.232.614.000     1.250.558.000     16.599.432.000       4.805.266.000     3.027.652.000     1.344.211.000     2.950.710.000     2.308.592.000     1.416.243.000        684.567.000     2.606.815.000     1.781.596.000     1.127.822.000        430.411.000     1.224.877.000        906.215.000        562.296.000      215.384.000
3KDURDURULAN FAALİYETLER                     -                       -                       -                     -                       -                       -                       -                     -                     -                     -                     -                     -                     -                     -                     -                     -                     -                     -       3K  DURDURULAN FAALİYETLER  DISCONTINUED OPERATIONS                                -                                -                                -                                -                                -                             -                                -                                -                             -                             -                             -                             -                             -                             -                             -                             -                             -                             -                             -                             -                             -                           -  
3KADurdurulan Faaliyetler Vergi Sonrası Dönem Karı (Zararı)                     -                       -                       -                     -                       -                       -                       -                     -                     -                     -                     -                     -                     -                     -                     -                     -                     -                     -       3KA  Durdurulan Faaliyetler Vergi Sonrası Dönem Karı (Zararı)  Profit After Taxes from Discontinued Operations                               -                                -                                -                                -                                -                             -                                -                                -                             -                             -                             -                             -                             -                             -                             -                             -                             -                             -                             -                             -                             -                           -  
3LDÖNEM KARI (ZARARI)          137.811          130.222          251.452        102.656          154.205            65.292          630.761          95.990        101.038          91.836          48.175        100.507          84.292          82.222        111.224          84.334        101.913          65.516     3L  DÖNEM KARI (ZARARI)  NET PROFIT AFTER TAXES        8.728.077.000       4.204.258.000     15.445.289.000       8.043.008.000       5.232.614.000     1.250.558.000     16.599.432.000       4.805.266.000     3.027.652.000     1.344.211.000     2.950.710.000     2.308.592.000     1.416.243.000        684.567.000     2.606.815.000     1.781.596.000     1.127.822.000        430.411.000     1.224.877.000        906.215.000        562.296.000      215.384.000
                                                
  • m_tarler's avatar
    m_tarler
    Oct 21, 2024

    deniztopcu  So if you want a more general solution using lookups for each you can do this:

    =LET(Rvals,$A$179:$A$214,Cvals,$C$1:$U$1,
    luTable,$AA$179:$AT$214,luRows,$X$179:$X$214, luCols,$AA$109:$AT$109,
    factor,$C$2:$U$2*$A$5,
    MAKEARRAY(ROWS(Rvals),COLUMNS(Cvals),LAMBDA(r,c,LET(
              rr,FILTER(luTable,INDEX(Rvals,r)=luRows),cc,XMATCH(INDEX(Cvals,c),luCols),
              (INDEX(rr,cc)-IF(RIGHT(INDEX(Cvals,c),1)="3",0,INDEX(rr,cc+1)))/INDEX(factor,c))))
    )

    basically the first 3 lines define each of the areas, then a MAKEARRAY

    then line 5 finds the row of data and which column

    then line 6 does the calculation

     

    if that isn't what you wanted and you just want to do 1 row at a time using the prior formula just pass it the corresponding row:

    =IFERROR(($AA$179:$AS$179-IF(RIGHT(C$1:U$1,1)="3",0,$AB$179:$AT$179))/C$2:U$2/$A$5,"")

    or if you need to do a lookup but only doing 1 row at time then:

    =LET(rr, FILTER($AA$179:$AT$214,A179=$X$179:$X$214),IFERROR((DROP(rr,,-1)-IF(RIGHT(C$1:U$1,1)="3",0,DROP(rr,,1)))/C$2:U$2/$A$5,""))

     

     

     

  • m_tarler's avatar
    m_tarler
    Steel Contributor

    deniztopcu In this case it appears the lookup column and row is the same as the target table column and row (i.e. each row of output table targets the same corresponding row in the lookup table and each column is looking at the corresponding column in the target) so the whole vlookup isn't even needed.  and as for the subtraction you only need to have the IF enclose the difference instead of repeating the first value 2x.  Here is my solution:

    =IFERROR(($AA$179:$AS$214-IF(RIGHT(C$1:U$1,1)="3",0,$AB$179:$AT$214))/C$2:U$2/$A$5,"")

    so I just refer to the range of values you want AA179:AS214 and subtract 0 if "3" or the same grid shifted to the right by 1 if not "3"  

    If however the lookups are not laid out the same between in and out and lookups are needed then you may need LAMBDA functions like BYROW, BYCOL, or MAP

    • deniztopcu's avatar
      deniztopcu
      Brass Contributor
      hi m_tarler
      I really like your approach. Thank you.
      How can we get the numerical data from the relevant line in one go by searching with "product code"?

      itemcode
      3B
      3C
      3CA
      3CAA
      3CAB
      3CAC
      .
      .

      Quarterly Data:
      1- array formula to do the entire row at once.
      2- Using an array formula for the entire block. ---> OK.
      • m_tarler's avatar
        m_tarler
        Steel Contributor

        deniztopcu  So if you want a more general solution using lookups for each you can do this:

        =LET(Rvals,$A$179:$A$214,Cvals,$C$1:$U$1,
        luTable,$AA$179:$AT$214,luRows,$X$179:$X$214, luCols,$AA$109:$AT$109,
        factor,$C$2:$U$2*$A$5,
        MAKEARRAY(ROWS(Rvals),COLUMNS(Cvals),LAMBDA(r,c,LET(
                  rr,FILTER(luTable,INDEX(Rvals,r)=luRows),cc,XMATCH(INDEX(Cvals,c),luCols),
                  (INDEX(rr,cc)-IF(RIGHT(INDEX(Cvals,c),1)="3",0,INDEX(rr,cc+1)))/INDEX(factor,c))))
        )

        basically the first 3 lines define each of the areas, then a MAKEARRAY

        then line 5 finds the row of data and which column

        then line 6 does the calculation

         

        if that isn't what you wanted and you just want to do 1 row at a time using the prior formula just pass it the corresponding row:

        =IFERROR(($AA$179:$AS$179-IF(RIGHT(C$1:U$1,1)="3",0,$AB$179:$AT$179))/C$2:U$2/$A$5,"")

        or if you need to do a lookup but only doing 1 row at time then:

        =LET(rr, FILTER($AA$179:$AT$214,A179=$X$179:$X$214),IFERROR((DROP(rr,,-1)-IF(RIGHT(C$1:U$1,1)="3",0,DROP(rr,,1)))/C$2:U$2/$A$5,""))

         

         

         

Resources