SUM in word table with Variable cells











up vote
1
down vote

favorite












I have a table in the Word program like the following:



Sample Picture



By opening this table file, I have to increase or decrease the number of rows. So I can not use the formula for the sum of the seasons (Because cell numbers change). In your opinion, how can I sum up the values of "Total Season 1" and "Total Season 2" and put it in "Total Seasons"?
Do you think Can I get help of the words "Total Season" or choosing the Bold words with VBA?










share|improve this question









New contributor




First Last is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
















  • 2




    Think about to convert this common Word table to Excel table.
    – Akina
    Nov 12 at 6:54










  • Unfortunately I can not run Excel. Do you think the words can not be used?
    – First Last
    Nov 12 at 6:58










  • Word is not designed for complex calculations, probably it can't calculate it for you using standard calculations. VBA can be used, however there are also limitations with VBA in Word tables, it's not really straightforward. Asking for code is generally off-topic here as it sounds we need to do your job, it's acceptable only if you demonstrate your own effort to solve the problem (= post code) and ask specific question on how to fix it.
    – Máté Juhász
    Nov 12 at 7:13






  • 1




    I can not run Excel. You do NOT need in Excel. Look Word, Insert pane, Tables tab. Table knob is clickable multi-variant listbox, and one of possible variants is inserting Excel table.
    – Akina
    Nov 12 at 8:08






  • 1




    Quick fix would be to split your table for each season so they are separate - you can make them seem almost same by setting the paragraph spacing for the gap between them to exactly 1pt. In your total cell for each season, select the cell contents (presumably a SUM ABOVE field) and create a bookmark eg bkSeason1Total. Then in your total seasons cell, you can insert a formula field that adds up the 2 bookmarks.
    – Tanya
    Nov 13 at 21:39















up vote
1
down vote

favorite












I have a table in the Word program like the following:



Sample Picture



By opening this table file, I have to increase or decrease the number of rows. So I can not use the formula for the sum of the seasons (Because cell numbers change). In your opinion, how can I sum up the values of "Total Season 1" and "Total Season 2" and put it in "Total Seasons"?
Do you think Can I get help of the words "Total Season" or choosing the Bold words with VBA?










share|improve this question









New contributor




First Last is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
















  • 2




    Think about to convert this common Word table to Excel table.
    – Akina
    Nov 12 at 6:54










  • Unfortunately I can not run Excel. Do you think the words can not be used?
    – First Last
    Nov 12 at 6:58










  • Word is not designed for complex calculations, probably it can't calculate it for you using standard calculations. VBA can be used, however there are also limitations with VBA in Word tables, it's not really straightforward. Asking for code is generally off-topic here as it sounds we need to do your job, it's acceptable only if you demonstrate your own effort to solve the problem (= post code) and ask specific question on how to fix it.
    – Máté Juhász
    Nov 12 at 7:13






  • 1




    I can not run Excel. You do NOT need in Excel. Look Word, Insert pane, Tables tab. Table knob is clickable multi-variant listbox, and one of possible variants is inserting Excel table.
    – Akina
    Nov 12 at 8:08






  • 1




    Quick fix would be to split your table for each season so they are separate - you can make them seem almost same by setting the paragraph spacing for the gap between them to exactly 1pt. In your total cell for each season, select the cell contents (presumably a SUM ABOVE field) and create a bookmark eg bkSeason1Total. Then in your total seasons cell, you can insert a formula field that adds up the 2 bookmarks.
    – Tanya
    Nov 13 at 21:39













up vote
1
down vote

favorite









up vote
1
down vote

favorite











I have a table in the Word program like the following:



Sample Picture



By opening this table file, I have to increase or decrease the number of rows. So I can not use the formula for the sum of the seasons (Because cell numbers change). In your opinion, how can I sum up the values of "Total Season 1" and "Total Season 2" and put it in "Total Seasons"?
Do you think Can I get help of the words "Total Season" or choosing the Bold words with VBA?










share|improve this question









New contributor




First Last is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











I have a table in the Word program like the following:



Sample Picture



By opening this table file, I have to increase or decrease the number of rows. So I can not use the formula for the sum of the seasons (Because cell numbers change). In your opinion, how can I sum up the values of "Total Season 1" and "Total Season 2" and put it in "Total Seasons"?
Do you think Can I get help of the words "Total Season" or choosing the Bold words with VBA?







microsoft-word vba






share|improve this question









New contributor




First Last is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




First Last is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited Nov 13 at 11:19









Toto

3,23291125




3,23291125






New contributor




First Last is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked Nov 12 at 6:49









First Last

163




163




New contributor




First Last is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





First Last is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






First Last is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








  • 2




    Think about to convert this common Word table to Excel table.
    – Akina
    Nov 12 at 6:54










  • Unfortunately I can not run Excel. Do you think the words can not be used?
    – First Last
    Nov 12 at 6:58










  • Word is not designed for complex calculations, probably it can't calculate it for you using standard calculations. VBA can be used, however there are also limitations with VBA in Word tables, it's not really straightforward. Asking for code is generally off-topic here as it sounds we need to do your job, it's acceptable only if you demonstrate your own effort to solve the problem (= post code) and ask specific question on how to fix it.
    – Máté Juhász
    Nov 12 at 7:13






  • 1




    I can not run Excel. You do NOT need in Excel. Look Word, Insert pane, Tables tab. Table knob is clickable multi-variant listbox, and one of possible variants is inserting Excel table.
    – Akina
    Nov 12 at 8:08






  • 1




    Quick fix would be to split your table for each season so they are separate - you can make them seem almost same by setting the paragraph spacing for the gap between them to exactly 1pt. In your total cell for each season, select the cell contents (presumably a SUM ABOVE field) and create a bookmark eg bkSeason1Total. Then in your total seasons cell, you can insert a formula field that adds up the 2 bookmarks.
    – Tanya
    Nov 13 at 21:39














  • 2




    Think about to convert this common Word table to Excel table.
    – Akina
    Nov 12 at 6:54










  • Unfortunately I can not run Excel. Do you think the words can not be used?
    – First Last
    Nov 12 at 6:58










  • Word is not designed for complex calculations, probably it can't calculate it for you using standard calculations. VBA can be used, however there are also limitations with VBA in Word tables, it's not really straightforward. Asking for code is generally off-topic here as it sounds we need to do your job, it's acceptable only if you demonstrate your own effort to solve the problem (= post code) and ask specific question on how to fix it.
    – Máté Juhász
    Nov 12 at 7:13






  • 1




    I can not run Excel. You do NOT need in Excel. Look Word, Insert pane, Tables tab. Table knob is clickable multi-variant listbox, and one of possible variants is inserting Excel table.
    – Akina
    Nov 12 at 8:08






  • 1




    Quick fix would be to split your table for each season so they are separate - you can make them seem almost same by setting the paragraph spacing for the gap between them to exactly 1pt. In your total cell for each season, select the cell contents (presumably a SUM ABOVE field) and create a bookmark eg bkSeason1Total. Then in your total seasons cell, you can insert a formula field that adds up the 2 bookmarks.
    – Tanya
    Nov 13 at 21:39








2




2




Think about to convert this common Word table to Excel table.
– Akina
Nov 12 at 6:54




Think about to convert this common Word table to Excel table.
– Akina
Nov 12 at 6:54












Unfortunately I can not run Excel. Do you think the words can not be used?
– First Last
Nov 12 at 6:58




Unfortunately I can not run Excel. Do you think the words can not be used?
– First Last
Nov 12 at 6:58












Word is not designed for complex calculations, probably it can't calculate it for you using standard calculations. VBA can be used, however there are also limitations with VBA in Word tables, it's not really straightforward. Asking for code is generally off-topic here as it sounds we need to do your job, it's acceptable only if you demonstrate your own effort to solve the problem (= post code) and ask specific question on how to fix it.
– Máté Juhász
Nov 12 at 7:13




Word is not designed for complex calculations, probably it can't calculate it for you using standard calculations. VBA can be used, however there are also limitations with VBA in Word tables, it's not really straightforward. Asking for code is generally off-topic here as it sounds we need to do your job, it's acceptable only if you demonstrate your own effort to solve the problem (= post code) and ask specific question on how to fix it.
– Máté Juhász
Nov 12 at 7:13




1




1




I can not run Excel. You do NOT need in Excel. Look Word, Insert pane, Tables tab. Table knob is clickable multi-variant listbox, and one of possible variants is inserting Excel table.
– Akina
Nov 12 at 8:08




I can not run Excel. You do NOT need in Excel. Look Word, Insert pane, Tables tab. Table knob is clickable multi-variant listbox, and one of possible variants is inserting Excel table.
– Akina
Nov 12 at 8:08




1




1




Quick fix would be to split your table for each season so they are separate - you can make them seem almost same by setting the paragraph spacing for the gap between them to exactly 1pt. In your total cell for each season, select the cell contents (presumably a SUM ABOVE field) and create a bookmark eg bkSeason1Total. Then in your total seasons cell, you can insert a formula field that adds up the 2 bookmarks.
– Tanya
Nov 13 at 21:39




Quick fix would be to split your table for each season so they are separate - you can make them seem almost same by setting the paragraph spacing for the gap between them to exactly 1pt. In your total cell for each season, select the cell contents (presumably a SUM ABOVE field) and create a bookmark eg bkSeason1Total. Then in your total seasons cell, you can insert a formula field that adds up the 2 bookmarks.
– Tanya
Nov 13 at 21:39










2 Answers
2






active

oldest

votes

















up vote
1
down vote













Hello dear friends who tried to help me! I worked on this topic the same day and I managed to solve the problem by writing the following code. I put this code here for everyone. If friends are willing, they can provide better codes for easier and faster running. be happy...



Sub CalculatingTotalSeasons()
ActiveDocument.Tables(1).Select
Selection.Copy
Selection.EndKey Unit:=wdStory
Selection.TypeParagraph
Selection.PasteAndFormat (wdFormatOriginalFormatting)

Dim t As Table
Dim r As Row
Dim ts As String
Set t = ActiveDocument.Tables(2)

ts = "Total Season"
For Each r In t.Rows
If Left(r.Cells(1).Range.Text, 12) <> ts Then r.Delete
Next r

With ActiveDocument.Tables(2)
ActiveDocument.Tables(2).Cell(1, 1).Select
Selection.Find.ClearFormatting
With Selection.Find
.Text = "Total Seasons"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
End With
Selection.Find.Execute
Selection.MoveRight Unit:=wdCell
Selection.InsertFormula Formula:="=SUM(ABOVE)", NumberFormat:=""
Selection.MoveLeft Unit:=wdCell
Selection.MoveRight Unit:=wdCell
Selection.Copy
ActiveDocument.Tables(2).Delete
End With

ActiveDocument.Tables(1).Select
With ActiveDocument.Tables(1)
ActiveDocument.Tables(1).Cell(1, 1).Select
Selection.Find.ClearFormatting
With Selection.Find
.Text = "Total Seasons"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
End With
Selection.Find.Execute
Selection.MoveRight Unit:=wdCell
Selection.PasteAndFormat (wdFormatPlainText)
End With

End Sub





share|improve this answer








New contributor




First Last is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

























    up vote
    0
    down vote













    To make a table in Word perform some automatic summation of values there are formatting steps you have to take. Below is an example of what you might want the final result to look like.



    enter image description here



    The shaded values in the image below are created from formula fields. In order for the "=SUM(ABOVE)" formula to work in the Subtotal rows, there must be a blank row or a non-numeric cell between the parts of the table. The red arrows point to the inserted blank rows. I have made them very narrow so they look like just a line separator, but in fact they are actually a blank row.



    In order to calculate the Grand Total, which is a sum of the two Subtotals, each Subtotal formula is enclosed within a bookmark. For this example they are named Materials and Services.



    enter image description here



    The field formulas are shown in the image below. They include the code needed for formatting.



    enter image description here



    To update the table after adding new data rows, you select the table and then press F9.



    enter image description here






    share|improve this answer





















    • Hi dear friend @Rich Michaels! thank you. I have read your article. But it seems a bit long way. In the answer section, I put a code that does not need to add an empty line and the bookmarks. Good luck.
      – First Last
      19 hours ago













    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "3"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });






    First Last is a new contributor. Be nice, and check out our Code of Conduct.










     

    draft saved


    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1374637%2fsum-in-word-table-with-variable-cells%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    1
    down vote













    Hello dear friends who tried to help me! I worked on this topic the same day and I managed to solve the problem by writing the following code. I put this code here for everyone. If friends are willing, they can provide better codes for easier and faster running. be happy...



    Sub CalculatingTotalSeasons()
    ActiveDocument.Tables(1).Select
    Selection.Copy
    Selection.EndKey Unit:=wdStory
    Selection.TypeParagraph
    Selection.PasteAndFormat (wdFormatOriginalFormatting)

    Dim t As Table
    Dim r As Row
    Dim ts As String
    Set t = ActiveDocument.Tables(2)

    ts = "Total Season"
    For Each r In t.Rows
    If Left(r.Cells(1).Range.Text, 12) <> ts Then r.Delete
    Next r

    With ActiveDocument.Tables(2)
    ActiveDocument.Tables(2).Cell(1, 1).Select
    Selection.Find.ClearFormatting
    With Selection.Find
    .Text = "Total Seasons"
    .Replacement.Text = ""
    .Forward = True
    .Wrap = wdFindContinue
    End With
    Selection.Find.Execute
    Selection.MoveRight Unit:=wdCell
    Selection.InsertFormula Formula:="=SUM(ABOVE)", NumberFormat:=""
    Selection.MoveLeft Unit:=wdCell
    Selection.MoveRight Unit:=wdCell
    Selection.Copy
    ActiveDocument.Tables(2).Delete
    End With

    ActiveDocument.Tables(1).Select
    With ActiveDocument.Tables(1)
    ActiveDocument.Tables(1).Cell(1, 1).Select
    Selection.Find.ClearFormatting
    With Selection.Find
    .Text = "Total Seasons"
    .Replacement.Text = ""
    .Forward = True
    .Wrap = wdFindContinue
    End With
    Selection.Find.Execute
    Selection.MoveRight Unit:=wdCell
    Selection.PasteAndFormat (wdFormatPlainText)
    End With

    End Sub





    share|improve this answer








    New contributor




    First Last is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.






















      up vote
      1
      down vote













      Hello dear friends who tried to help me! I worked on this topic the same day and I managed to solve the problem by writing the following code. I put this code here for everyone. If friends are willing, they can provide better codes for easier and faster running. be happy...



      Sub CalculatingTotalSeasons()
      ActiveDocument.Tables(1).Select
      Selection.Copy
      Selection.EndKey Unit:=wdStory
      Selection.TypeParagraph
      Selection.PasteAndFormat (wdFormatOriginalFormatting)

      Dim t As Table
      Dim r As Row
      Dim ts As String
      Set t = ActiveDocument.Tables(2)

      ts = "Total Season"
      For Each r In t.Rows
      If Left(r.Cells(1).Range.Text, 12) <> ts Then r.Delete
      Next r

      With ActiveDocument.Tables(2)
      ActiveDocument.Tables(2).Cell(1, 1).Select
      Selection.Find.ClearFormatting
      With Selection.Find
      .Text = "Total Seasons"
      .Replacement.Text = ""
      .Forward = True
      .Wrap = wdFindContinue
      End With
      Selection.Find.Execute
      Selection.MoveRight Unit:=wdCell
      Selection.InsertFormula Formula:="=SUM(ABOVE)", NumberFormat:=""
      Selection.MoveLeft Unit:=wdCell
      Selection.MoveRight Unit:=wdCell
      Selection.Copy
      ActiveDocument.Tables(2).Delete
      End With

      ActiveDocument.Tables(1).Select
      With ActiveDocument.Tables(1)
      ActiveDocument.Tables(1).Cell(1, 1).Select
      Selection.Find.ClearFormatting
      With Selection.Find
      .Text = "Total Seasons"
      .Replacement.Text = ""
      .Forward = True
      .Wrap = wdFindContinue
      End With
      Selection.Find.Execute
      Selection.MoveRight Unit:=wdCell
      Selection.PasteAndFormat (wdFormatPlainText)
      End With

      End Sub





      share|improve this answer








      New contributor




      First Last is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




















        up vote
        1
        down vote










        up vote
        1
        down vote









        Hello dear friends who tried to help me! I worked on this topic the same day and I managed to solve the problem by writing the following code. I put this code here for everyone. If friends are willing, they can provide better codes for easier and faster running. be happy...



        Sub CalculatingTotalSeasons()
        ActiveDocument.Tables(1).Select
        Selection.Copy
        Selection.EndKey Unit:=wdStory
        Selection.TypeParagraph
        Selection.PasteAndFormat (wdFormatOriginalFormatting)

        Dim t As Table
        Dim r As Row
        Dim ts As String
        Set t = ActiveDocument.Tables(2)

        ts = "Total Season"
        For Each r In t.Rows
        If Left(r.Cells(1).Range.Text, 12) <> ts Then r.Delete
        Next r

        With ActiveDocument.Tables(2)
        ActiveDocument.Tables(2).Cell(1, 1).Select
        Selection.Find.ClearFormatting
        With Selection.Find
        .Text = "Total Seasons"
        .Replacement.Text = ""
        .Forward = True
        .Wrap = wdFindContinue
        End With
        Selection.Find.Execute
        Selection.MoveRight Unit:=wdCell
        Selection.InsertFormula Formula:="=SUM(ABOVE)", NumberFormat:=""
        Selection.MoveLeft Unit:=wdCell
        Selection.MoveRight Unit:=wdCell
        Selection.Copy
        ActiveDocument.Tables(2).Delete
        End With

        ActiveDocument.Tables(1).Select
        With ActiveDocument.Tables(1)
        ActiveDocument.Tables(1).Cell(1, 1).Select
        Selection.Find.ClearFormatting
        With Selection.Find
        .Text = "Total Seasons"
        .Replacement.Text = ""
        .Forward = True
        .Wrap = wdFindContinue
        End With
        Selection.Find.Execute
        Selection.MoveRight Unit:=wdCell
        Selection.PasteAndFormat (wdFormatPlainText)
        End With

        End Sub





        share|improve this answer








        New contributor




        First Last is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.









        Hello dear friends who tried to help me! I worked on this topic the same day and I managed to solve the problem by writing the following code. I put this code here for everyone. If friends are willing, they can provide better codes for easier and faster running. be happy...



        Sub CalculatingTotalSeasons()
        ActiveDocument.Tables(1).Select
        Selection.Copy
        Selection.EndKey Unit:=wdStory
        Selection.TypeParagraph
        Selection.PasteAndFormat (wdFormatOriginalFormatting)

        Dim t As Table
        Dim r As Row
        Dim ts As String
        Set t = ActiveDocument.Tables(2)

        ts = "Total Season"
        For Each r In t.Rows
        If Left(r.Cells(1).Range.Text, 12) <> ts Then r.Delete
        Next r

        With ActiveDocument.Tables(2)
        ActiveDocument.Tables(2).Cell(1, 1).Select
        Selection.Find.ClearFormatting
        With Selection.Find
        .Text = "Total Seasons"
        .Replacement.Text = ""
        .Forward = True
        .Wrap = wdFindContinue
        End With
        Selection.Find.Execute
        Selection.MoveRight Unit:=wdCell
        Selection.InsertFormula Formula:="=SUM(ABOVE)", NumberFormat:=""
        Selection.MoveLeft Unit:=wdCell
        Selection.MoveRight Unit:=wdCell
        Selection.Copy
        ActiveDocument.Tables(2).Delete
        End With

        ActiveDocument.Tables(1).Select
        With ActiveDocument.Tables(1)
        ActiveDocument.Tables(1).Cell(1, 1).Select
        Selection.Find.ClearFormatting
        With Selection.Find
        .Text = "Total Seasons"
        .Replacement.Text = ""
        .Forward = True
        .Wrap = wdFindContinue
        End With
        Selection.Find.Execute
        Selection.MoveRight Unit:=wdCell
        Selection.PasteAndFormat (wdFormatPlainText)
        End With

        End Sub






        share|improve this answer








        New contributor




        First Last is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.









        share|improve this answer



        share|improve this answer






        New contributor




        First Last is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.









        answered 19 hours ago









        First Last

        163




        163




        New contributor




        First Last is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.





        New contributor





        First Last is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.






        First Last is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.
























            up vote
            0
            down vote













            To make a table in Word perform some automatic summation of values there are formatting steps you have to take. Below is an example of what you might want the final result to look like.



            enter image description here



            The shaded values in the image below are created from formula fields. In order for the "=SUM(ABOVE)" formula to work in the Subtotal rows, there must be a blank row or a non-numeric cell between the parts of the table. The red arrows point to the inserted blank rows. I have made them very narrow so they look like just a line separator, but in fact they are actually a blank row.



            In order to calculate the Grand Total, which is a sum of the two Subtotals, each Subtotal formula is enclosed within a bookmark. For this example they are named Materials and Services.



            enter image description here



            The field formulas are shown in the image below. They include the code needed for formatting.



            enter image description here



            To update the table after adding new data rows, you select the table and then press F9.



            enter image description here






            share|improve this answer





















            • Hi dear friend @Rich Michaels! thank you. I have read your article. But it seems a bit long way. In the answer section, I put a code that does not need to add an empty line and the bookmarks. Good luck.
              – First Last
              19 hours ago

















            up vote
            0
            down vote













            To make a table in Word perform some automatic summation of values there are formatting steps you have to take. Below is an example of what you might want the final result to look like.



            enter image description here



            The shaded values in the image below are created from formula fields. In order for the "=SUM(ABOVE)" formula to work in the Subtotal rows, there must be a blank row or a non-numeric cell between the parts of the table. The red arrows point to the inserted blank rows. I have made them very narrow so they look like just a line separator, but in fact they are actually a blank row.



            In order to calculate the Grand Total, which is a sum of the two Subtotals, each Subtotal formula is enclosed within a bookmark. For this example they are named Materials and Services.



            enter image description here



            The field formulas are shown in the image below. They include the code needed for formatting.



            enter image description here



            To update the table after adding new data rows, you select the table and then press F9.



            enter image description here






            share|improve this answer





















            • Hi dear friend @Rich Michaels! thank you. I have read your article. But it seems a bit long way. In the answer section, I put a code that does not need to add an empty line and the bookmarks. Good luck.
              – First Last
              19 hours ago















            up vote
            0
            down vote










            up vote
            0
            down vote









            To make a table in Word perform some automatic summation of values there are formatting steps you have to take. Below is an example of what you might want the final result to look like.



            enter image description here



            The shaded values in the image below are created from formula fields. In order for the "=SUM(ABOVE)" formula to work in the Subtotal rows, there must be a blank row or a non-numeric cell between the parts of the table. The red arrows point to the inserted blank rows. I have made them very narrow so they look like just a line separator, but in fact they are actually a blank row.



            In order to calculate the Grand Total, which is a sum of the two Subtotals, each Subtotal formula is enclosed within a bookmark. For this example they are named Materials and Services.



            enter image description here



            The field formulas are shown in the image below. They include the code needed for formatting.



            enter image description here



            To update the table after adding new data rows, you select the table and then press F9.



            enter image description here






            share|improve this answer












            To make a table in Word perform some automatic summation of values there are formatting steps you have to take. Below is an example of what you might want the final result to look like.



            enter image description here



            The shaded values in the image below are created from formula fields. In order for the "=SUM(ABOVE)" formula to work in the Subtotal rows, there must be a blank row or a non-numeric cell between the parts of the table. The red arrows point to the inserted blank rows. I have made them very narrow so they look like just a line separator, but in fact they are actually a blank row.



            In order to calculate the Grand Total, which is a sum of the two Subtotals, each Subtotal formula is enclosed within a bookmark. For this example they are named Materials and Services.



            enter image description here



            The field formulas are shown in the image below. They include the code needed for formatting.



            enter image description here



            To update the table after adding new data rows, you select the table and then press F9.



            enter image description here







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered 2 days ago









            Rich Michaels

            1,0192210




            1,0192210












            • Hi dear friend @Rich Michaels! thank you. I have read your article. But it seems a bit long way. In the answer section, I put a code that does not need to add an empty line and the bookmarks. Good luck.
              – First Last
              19 hours ago




















            • Hi dear friend @Rich Michaels! thank you. I have read your article. But it seems a bit long way. In the answer section, I put a code that does not need to add an empty line and the bookmarks. Good luck.
              – First Last
              19 hours ago


















            Hi dear friend @Rich Michaels! thank you. I have read your article. But it seems a bit long way. In the answer section, I put a code that does not need to add an empty line and the bookmarks. Good luck.
            – First Last
            19 hours ago






            Hi dear friend @Rich Michaels! thank you. I have read your article. But it seems a bit long way. In the answer section, I put a code that does not need to add an empty line and the bookmarks. Good luck.
            – First Last
            19 hours ago












            First Last is a new contributor. Be nice, and check out our Code of Conduct.










             

            draft saved


            draft discarded


















            First Last is a new contributor. Be nice, and check out our Code of Conduct.













            First Last is a new contributor. Be nice, and check out our Code of Conduct.












            First Last is a new contributor. Be nice, and check out our Code of Conduct.















             


            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1374637%2fsum-in-word-table-with-variable-cells%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Список кардиналов, возведённых папой римским Каликстом III

            Deduzione

            Mysql.sock missing - “Can't connect to local MySQL server through socket”