Convert XML to MS Excel XML - formula syntax

I am converting some XML for viewing in MS Excel. There is a very good recommendation on how to create a schema - http://msdn.microsoft.com/en-us/library/aa140066(v=office.10).aspx . This blog is helpful too.

I am having trouble nesting a formula in a cell, so:    <Cell ss:Index="2" ss:Formula="=SUM(R[-3]C[0]:R[-1]C[0])">

       <Data ss:Type="Number"></Data>

     </Cell>

pretty simple. This will sum the values ​​on line 3 of line above to line 1 above.

However, I need a formula (in A1 format, not R1C1) . =SUMIF(A:A,"Assignments",B:B)

I have tried many options including

  • ss:Formula="=SUMIF(C[-1]:C[-1],Assignments,C[0]:C[0])"

    , but the cell definition in this case is . =SUMIF(A:A,Assignments,B:B)

  • ss:Formula="=SUMIF(C[-1]:C[-1],"Assignments",C[0]:C[0])"

    but the book gets corrupt and won't open.

  • ss:Formula="=SUMIF(C[-1]:C[-1],'Assignments',C[0]:C[0])"

    , but the cell definition in this case is . 0

The quotes are causing the problem. Does anyone know the correct syntax to get the desired formula in a cell?

+3


source to share


1 answer


The answer is to know the XML escape characters. What characters do I need to hide in XML documents?

The line in the code you want:



ss:Formula="=SUMIF(C1:C1, &quot;Assignments&quot;,C[0]:C[0])"

+4


source







All Articles