Excel计算链

问题描述 投票:0回答:1

第一个问题:

r
显然给出了范围,
i
代表什么?

第二个问题:链上好像是按照我在单元格中输入公式的时间来排序计算的?看起来很尴尬,

calcChain
会计算说
I1
,然后是
I4
,然后是
G13
,而不是
I10

此外,

calcChain
在计算
I13
的直接先例之前计算
I13
$G$13,$E$13,$C$13,$A$13

这是我的

calcChain

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<calcChain xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
    <c r="I1" i="1" l="1"/>
    <c r="I4" i="1"/>
    <c r="I7" i="1"/>
    <c r="I10" i="1"/>
    <c r="I13" i="1"/>
    <c r="G13" i="1"/>
    <c r="E13" i="1"/>
    <c r="C13" i="1"/>
    <c r="A13" i="1"/>
    <c r="A7" i="1"/>
    <c r="E10" i="1"/>
    <c r="C10" i="1"/>
    <c r="A10" i="1"/>
    <c r="G10" i="1"/>
    <c r="C4" i="1"/>
    <c r="C7" i="1" s="1"/>
    <c r="C1" i="1"/>
    <c r="E1" i="1" s="1"/>
    <c r="G1" i="1" s="1"/>
    <c r="A4" i="1"/>
    <c r="E4" i="1" l="1"/>
    <c r="G4" i="1" s="1"/>
    <c r="E7" i="1"/>
    <c r="G7" i="1"/>
</calcChain>

这是我的

sheet1.xml

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<worksheet
xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"
xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="x14ac"
xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac">
    <dimension ref="A1:I13"/>
    <sheetViews>
        <sheetView tabSelected="1" workbookViewId="0">
            <selection activeCell="H14" sqref="H14"/>
        </sheetView>
    </sheetViews>
    <sheetFormatPr defaultRowHeight="15" x14ac:dyDescent="0.25"/>
    <sheetData>
        <row r="1" spans="1:9" x14ac:dyDescent="0.25">
            <c r="A1"><v>3</v></c>
            <c r="C1"><f>A1*5</f><v>15</v></c>
            <c r="E1"><f>C1*2</f><v>30</v></c>
            <c r="G1"><f>E1*3</f><v>90</v></c>
            <c r="I1"><f>G1*2</f><v>180</v></c>
        </row>
        <row r="4" spans="1:9" x14ac:dyDescent="0.25">
            <c r="A4"><f>A1*5</f><v>15</v></c>
            <c r="C4"><f>A4</f><v>15</v></c>
            <c r="E4"><f>C4*2</f><v>30</v></c>
            <c r="G4"><f>E4*3</f><v>90</v></c>
            <c r="I4"><f>G4*2</f><v>180</v></c>
        </row>
        <row r="7" spans="1:9" x14ac:dyDescent="0.25">
            <c r="A7"><f>A4*2</f><v>30</v></c>
            <c r="C7"><f>C4*2</f><v>30</v></c>
            <c r="E7"><f>C7+A7</f><v>60</v></c>
            <c r="G7"><f>E7*3</f><v>180</v></c>
            <c r="I7"><f>G7*2</f><v>360</v></c>
        </row>
        <row r="10" spans="1:9" x14ac:dyDescent="0.25">
            <c r="A10"><f>A7*3</f><v>90</v></c>
            <c r="C10"><f>C7*3</f><v>90</v></c>
            <c r="E10"><f>E7*3</f><v>180</v></c>
            <c r="G10"><f>E10+C10+A10</f><v>360</v></c>
            <c r="I10"><f>G10*2</f><v>720</v></c>
        </row>
        <row r="13" spans="1:9" x14ac:dyDescent="0.25">
            <c r="A13"><f>A10*2</f><v>180</v></c>
            <c r="C13"><f>C10*2</f><v>180</v></c>
            <c r="E13"><f>E10*2</f><v>360</v></c>
            <c r="G13"><f>G10*2</f><v>720</v></c>
            <c r="I13"><f>SUM(G13,E13,C13,A13)</f><v>1440</v></c>
        </row>
    </sheetData>
    <pageMargins left="0.7" right="0.7" top="0.75" bottom="0.75"
                 header="0.3" footer="0.3"/>
</worksheet>  

数据:

excel xml vba
1个回答
0
投票

在我看来,

i
属性表示
sheetId
,你可以在
xl/workbook.xml
中找到它,它可能包含以下数据:

<sheets>
    <sheet name="RAW1" sheetId="3" r:id="rId1"/>
    <sheet name="RAW2" sheetId="4" r:id="rId2"/>
</sheets>

sheetId
中的
RAW1
是3,所以如果您想添加
A2
,然后将此表中的
A3
添加到
calcChain
。你应该这样做:

<calcChain xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
    <c r="A2" i="3"/>
    <c r="A3" i="3"/>
</calcChain>

注意,我们来区分属性:

sheetId
r:id
r:id
是保存的名称,
r:id=1
表示Excel会以名称
sheet1
来保存此工作表。

© www.soinside.com 2019 - 2024. All rights reserved.