0

DB /アプリの開発が成功した後、私は採用チームが使用する非常に高度なスプレッドシートを作成する任務を負いました。

簡単に言えば、キャンプでの「必要なスタッフ」と「出席者」を比較するための公式があります。

出席とスタッフのデータは、ODBC接続を介して他の2つのワークシートに取り込まれ、かなりのピボットテーブルに変換されています。

かなり理解しやすいですが、最終的には非常にプログラム的に複雑な計算を行う必要があります。これには約8ステップかかります。

[私の知る限り]セル内で短期変数を作成することはできず、外部セルを参照するためにかなりの文字数がかかるという事実と組み合わせると、視覚的に(概念的にではないにしても)複雑になります。方式。

最終的に...データの不確実性に対処するためにIFERROR()を使用してデータ検証を追加したので、実際にはセルの文字数制限(約8100文字)に達したことを意味します。セルを縮小するFSVOを試しましたが、制限を下回っていません。

だから-今あなたは問題を知っています-ここに一連の質問があります:

  • 制限を拡張する方法はありますか?
  • セル内に変数を作成する方法はありますか(これも問題を解決します)?
  • VBはこの種の問題に適していますか?

答えは「VBを学んでください」となるのではないかと思います...これは避けようとしていました。私は限界から約3行離れていると思います、そしてそれが試行錯誤された解決策であることを考えると、それを再コーディングしなければならないのは残念です。

公式を含めるように編集

=IF(
    OR(
        IFERROR(
        GETPIVOTDATA("Child ID",'Child Numbers 2013'!$A$1,"Venue",$A4,"Age group","4/5 years","Activity","Multi-Active","date",B$1-DATE(YEAR(B$1),1,0)),0),
        IFERROR(
        GETPIVOTDATA("Child ID",'Child Numbers 2013'!$A$1,"Venue",$A4,"Age group","6/7 years","Activity","Multi-Active","date",B$1-DATE(YEAR(B$1),1,0)),0),
        IFERROR(
        GETPIVOTDATA("Child ID",'Child Numbers 2013'!$A$1,"Venue",$A4,"Age group","8 + years","Activity","Multi-Active","date",B$1-DATE(YEAR(B$1),1,0)),0),

        IFERROR(
        GETPIVOTDATA("Child ID",'Child Numbers 2013'!$A$1,"Venue",$A4,"Age group","4/5 years","Activity","ISS","date",B$1-DATE(YEAR(B$1),1,0)),0),
        IFERROR(
        GETPIVOTDATA("Child ID",'Child Numbers 2013'!$A$1,"Venue",$A4,"Age group","6/7 years","Activity","ISS","date",B$1-DATE(YEAR(B$1),1,0)),0),
        IFERROR(
        GETPIVOTDATA("Child ID",'Child Numbers 2013'!$A$1,"Venue",$A4,"Age group","8 + years","Activity","ISS","date",B$1-DATE(YEAR(B$1),1,0)),0),

        IFERROR(
        GETPIVOTDATA("Child ID",'Child Numbers 2013'!$A$1,"Venue",$A4,"Age group","4/5 years","Activity","MVC","date",B$1-DATE(YEAR(B$1),1,0)),0),
        IFERROR(
        GETPIVOTDATA("Child ID",'Child Numbers 2013'!$A$1,"Venue",$A4,"Age group","6/7 years","Activity","MVC","date",B$1-DATE(YEAR(B$1),1,0)),0),
        IFERROR(
        GETPIVOTDATA("Child ID",'Child Numbers 2013'!$A$1,"Venue",$A4,"Age group","8 + years","Activity","MVC","date",B$1-DATE(YEAR(B$1),1,0)),0)
    ),

 SUM(
        IF(
            OR(
                IFERROR(
                GETPIVOTDATA("Child ID",'Child Numbers 2013'!$A$1,"Venue",$A4,"Age group","4/5 years","Activity","Multi-Active","date",B$1-DATE(YEAR(B$1),1,0)),0),
                IFERROR(
                GETPIVOTDATA("Child ID",'Child Numbers 2013'!$A$1,"Venue",$A4,"Age group","6/7 years","Activity","Multi-Active","date",B$1-DATE(YEAR(B$1),1,0)),0),
                IFERROR(
                GETPIVOTDATA("Child ID",'Child Numbers 2013'!$A$1,"Venue",$A4,"Age group","8 + years","Activity","Multi-Active","date",B$1-DATE(YEAR(B$1),1,0)),0)
            ),
                SUM(
                    (
                    (IFERROR(GETPIVOTDATA("Child ID",'Child Numbers 2013'!$A$1,"Venue",$A4,"Age group","4/5 years","Activity","Multi-Active","date",B$1-DATE(YEAR(B$1),1,0)),0)+($B$49-MOD(IFERROR(GETPIVOTDATA("Child ID",'Child Numbers 2013'!$A$1,"Venue",$A4,"Age group","4/5 years","Activity","Multi-Active","date",B$1-DATE(YEAR(B$1),1,0)),0),$B$49)))/$B$49
                    )
                    +
                    (
                    ((IFERROR(GETPIVOTDATA("Child ID",'Child Numbers 2013'!$A$1,"Venue",$A4,"Age group","6/7 years","Activity","Multi-Active","date",B$1-DATE(YEAR(B$1),1,0)),0)-($B$49-MOD(IFERROR(GETPIVOTDATA("Child ID",'Child Numbers 2013'!$A$1,"Venue",$A4,"Age group","4/5 years","Activity","Multi-Active","date",B$1-DATE(YEAR(B$1),1,0)),0),$B$49)))+($B$50-(MOD((IFERROR(GETPIVOTDATA("Child ID",'Child Numbers 2013'!$A$1,"Venue",$A4,"Age group","6/7 years","Activity","Multi-Active","date",B$1-DATE(YEAR(B$1),1,0)),0)-($B$49-MOD(IFERROR(GETPIVOTDATA("Child ID",'Child Numbers 2013'!$A$1,"Venue",$A4,"Age group","4/5 years","Activity","Multi-Active","date",B$1-DATE(YEAR(B$1),1,0)),0),$B$49))),$B$50))))/$B$50
                    )
                    +
                    (
                    CEILING(
                        IF(
                            ((IFERROR(GETPIVOTDATA("Child ID",'Child Numbers 2013'!$A$1,"Venue",$A4,"Age group","8 + years","Activity","Multi-Active","date",B$1-DATE(YEAR(B$1),1,0)),0)-($B$50-(MOD((IFERROR(GETPIVOTDATA("Child ID",'Child Numbers 2013'!$A$1,"Venue",$A4,"Age group","6/7 years","Activity","Multi-Active","date",B$1-DATE(YEAR(B$1),1,0)),0)-($B$49-MOD(IFERROR(GETPIVOTDATA("Child ID",'Child Numbers 2013'!$A$1,"Venue",$A4,"Age group","4/5 years","Activity","Multi-Active","date",B$1-DATE(YEAR(B$1),1,0)),0),$B$49))),$B$50))))/$B$51)<0,
                            0,
                            (
                            (IFERROR(GETPIVOTDATA("Child ID",'Child Numbers 2013'!$A$1,"Venue",$A4,"Age group","8 + years","Activity","Multi-Active","date",B$1-DATE(YEAR(B$1),1,0)),0)-($B$50-(MOD((IFERROR(GETPIVOTDATA("Child ID",'Child Numbers 2013'!$A$1,"Venue",$A4,"Age group","6/7 years","Activity","Multi-Active","date",B$1-DATE(YEAR(B$1),1,0)),0)-($B$49-MOD(IFERROR(GETPIVOTDATA("Child ID",'Child Numbers 2013'!$A$1,"Venue",$A4,"Age group","4/5 years","Activity","Multi-Active","date",B$1-DATE(YEAR(B$1),1,0)),0),$B$49))),$B$50))))/$B$51
                            )
                        ),1
                    )
                    )
                )
                ,
                0
        )
        +

        IF(
            OR(
                IFERROR(
                GETPIVOTDATA("Child ID",'Child Numbers 2013'!$A$1,"Venue",$A4,"Age group","4/5 years","Activity","ISS","date",B$1-DATE(YEAR(B$1),1,0)),0),
                IFERROR(
                GETPIVOTDATA("Child ID",'Child Numbers 2013'!$A$1,"Venue",$A4,"Age group","6/7 years","Activity","ISS","date",B$1-DATE(YEAR(B$1),1,0)),0),
                IFERROR(
                GETPIVOTDATA("Child ID",'Child Numbers 2013'!$A$1,"Venue",$A4,"Age group","8 + years","Activity","ISS","date",B$1-DATE(YEAR(B$1),1,0)),0)
            ),      
            SUM(
                (
                (IFERROR(GETPIVOTDATA("Child ID",'Child Numbers 2013'!$A$1,"Venue",$A4,"Age group","4/5 years","Activity","ISS","date",B$1-DATE(YEAR(B$1),1,0)),0)+($B$49-MOD(IFERROR(GETPIVOTDATA("Child ID",'Child Numbers 2013'!$A$1,"Venue",$A4,"Age group","4/5 years","Activity","ISS","date",B$1-DATE(YEAR(B$1),1,0)),0),$B$49)))/$B$49
                )
                +
                (
                ((IFERROR(GETPIVOTDATA("Child ID",'Child Numbers 2013'!$A$1,"Venue",$A4,"Age group","6/7 years","Activity","ISS","date",B$1-DATE(YEAR(B$1),1,0)),0)-($B$49-MOD(IFERROR(GETPIVOTDATA("Child ID",'Child Numbers 2013'!$A$1,"Venue",$A4,"Age group","4/5 years","Activity","ISS","date",B$1-DATE(YEAR(B$1),1,0)),0),$B$49)))+($B$50-(MOD((IFERROR(GETPIVOTDATA("Child ID",'Child Numbers 2013'!$A$1,"Venue",$A4,"Age group","6/7 years","Activity","ISS","date",B$1-DATE(YEAR(B$1),1,0)),0)-($B$49-MOD(IFERROR(GETPIVOTDATA("Child ID",'Child Numbers 2013'!$A$1,"Venue",$A4,"Age group","4/5 years","Activity","ISS","date",B$1-DATE(YEAR(B$1),1,0)),0),$B$49))),$B$50))))/$B$50
                )
                +
                (
                    CEILING(
                    IF(
                    ((IFERROR(GETPIVOTDATA("Child ID",'Child Numbers 2013'!$A$1,"Venue",$A4,"Age group","8 + years","Activity","ISS","date",B$1-DATE(YEAR(B$1),1,0)),0)-($B$50-(MOD((IFERROR(GETPIVOTDATA("Child ID",'Child Numbers 2013'!$A$1,"Venue",$A4,"Age group","6/7 years","Activity","ISS","date",B$1-DATE(YEAR(B$1),1,0)),0)-($B$49-MOD(IFERROR(GETPIVOTDATA("Child ID",'Child Numbers 2013'!$A$1,"Venue",$A4,"Age group","4/5 years","Activity","ISS","date",B$1-DATE(YEAR(B$1),1,0)),0),$B$49))),$B$50))))/$B$51)<0,
                    0,
                    (
                    (IFERROR(GETPIVOTDATA("Child ID",'Child Numbers 2013'!$A$1,"Venue",$A4,"Age group","8 + years","Activity","ISS","date",B$1-DATE(YEAR(B$1),1,0)),0)-($B$50-(MOD((IFERROR(GETPIVOTDATA("Child ID",'Child Numbers 2013'!$A$1,"Venue",$A4,"Age group","6/7 years","Activity","ISS","date",B$1-DATE(YEAR(B$1),1,0)),0)-($B$49-MOD(IFERROR(GETPIVOTDATA("Child ID",'Child Numbers 2013'!$A$1,"Venue",$A4,"Age group","4/5 years","Activity","ISS","date",B$1-DATE(YEAR(B$1),1,0)),0),$B$49))),$B$50))))/$B$51
                    )
                    ),1
                    )
                )
            )
            ,
            0
        )       
        +
        SUM(
                (
                (IFERROR(GETPIVOTDATA("Child ID",'Child Numbers 2013'!$A$1,"Venue",$A4,"Age group","4/5 years","Activity","MVC","date",B$1-DATE(YEAR(B$1),1,0)),0)+($B$49-MOD(IFERROR(GETPIVOTDATA("Child ID",'Child Numbers 2013'!$A$1,"Venue",$A4,"Age group","4/5 years","Activity","MVC","date",B$1-DATE(YEAR(B$1),1,0)),0),$B$49)))/$B$49
                )
                +
                (
                ((IFERROR(GETPIVOTDATA("Child ID",'Child Numbers 2013'!$A$1,"Venue",$A4,"Age group","6/7 years","Activity","MVC","date",B$1-DATE(YEAR(B$1),1,0)),0)-($B$49-MOD(IFERROR(GETPIVOTDATA("Child ID",'Child Numbers 2013'!$A$1,"Venue",$A4,"Age group","4/5 years","Activity","MVC","date",B$1-DATE(YEAR(B$1),1,0)),0),$B$49)))+($B$50-(MOD((IFERROR(GETPIVOTDATA("Child ID",'Child Numbers 2013'!$A$1,"Venue",$A4,"Age group","6/7 years","Activity","MVC","date",B$1-DATE(YEAR(B$1),1,0)),0)-($B$49-MOD(IFERROR(GETPIVOTDATA("Child ID",'Child Numbers 2013'!$A$1,"Venue",$A4,"Age group","4/5 years","Activity","MVC","date",B$1-DATE(YEAR(B$1),1,0)),0),$B$49))),$B$50))))/$B$50
                )
                +
                (
                CEILING(
                        IF(
                         ((IFERROR(GETPIVOTDATA("Child ID",'Child Numbers 2013'!$A$1,"Venue",$A4,"Age group","8 + years","Activity","MVC","date",B$1-DATE(YEAR(B$1),1,0)),0)-($B$50-(MOD((IFERROR(GETPIVOTDATA("Child ID",'Child Numbers 2013'!$A$1,"Venue",$A4,"Age group","6/7 years","Activity","MVC","date",B$1-DATE(YEAR(B$1),1,0)),0)-($B$49-MOD(IFERROR(GETPIVOTDATA("Child ID",'Child Numbers 2013'!$A$1,"Venue",$A4,"Age group","4/5 years","Activity","MVC","date",B$1-DATE(YEAR(B$1),1,0)),0),$B$49))),$B$50))))/$B$51)<0,
                         0,
                         (
                         (IFERROR(GETPIVOTDATA("Child ID",'Child Numbers 2013'!$A$1,"Venue",$A4,"Age group","8 + years","Activity","MVC","date",B$1-DATE(YEAR(B$1),1,0)),0)-($B$50-(MOD((IFERROR(GETPIVOTDATA("Child ID",'Child Numbers 2013'!$A$1,"Venue",$A4,"Age group","6/7 years","Activity","MVC","date",B$1-DATE(YEAR(B$1),1,0)),0)-($B$49-MOD(IFERROR(GETPIVOTDATA("Child ID",'Child Numbers 2013'!$A$1,"Venue",$A4,"Age group","4/5 years","Activity","MVC","date",B$1-DATE(YEAR(B$1),1,0)),0),$B$49))),$B$50))))/$B$51
                         )
                        ),1
                    )
                )
        )       
 ),

 "-"
)
4

1 に答える 1

0

定義された名前はそれをクラックしました。参考までに - 外部ピボット テーブルへの参照を完全な名前ではなく CN に再定義しました。これにより、数百文字が節約されました。皆さんありがとう!これを提案したすべての人をマークアップしました。

于 2013-03-12T15:37:34.147 に答える