Ask LibreOffice - RSS feedhttps://ask.libreoffice.org/en/questions/Questions and answers for LibreOfficeenFri, 14 Apr 2017 12:37:09 +0200COUNTIF with multiplication.https://ask.libreoffice.org/en/question/92772/countif-with-multiplication/I'm trying to create a spreadsheet for counting various items of same type.
I have two columns. One is `color`, the other is `count`. I may have many rows containing the same value for color (e.g. Blue), I also have a count column, which shows how many items that I have for the same row (e.g. 3). So while counting instead of adding `1 ` for each row, I want to add `count` amount to the total sum for that color.
e.g. If a row contains Blue as `color` and 3 as `count`, I want to add `3` to the total number of blues.Fri, 14 Apr 2017 10:43:15 +0200https://ask.libreoffice.org/en/question/92772/countif-with-multiplication/Answer by JohnSUN for <p>I'm trying to create a spreadsheet for counting various items of same type.</p>
<p>I have two columns. One is <code>color</code>, the other is <code>count</code>. I may have many rows containing the same value for color (e.g. Blue), I also have a count column, which shows how many items that I have for the same row (e.g. 3). So while counting instead of adding <code>1</code> for each row, I want to add <code>count</code> amount to the total sum for that color.</p>
<p>e.g. If a row contains Blue as <code>color</code> and 3 as <code>count</code>, I want to add <code>3</code> to the total number of blues.</p>
https://ask.libreoffice.org/en/question/92772/countif-with-multiplication/?answer=92774#post-id-92774See [Data - Subtotals](https://help.libreoffice.org/index.php?title=Calc/Subtotals&Language=en-US&System=WIN&Version=5.3#bm_id3154515)
![SubTotals](/upfiles/14921607456596018.gif)Fri, 14 Apr 2017 11:06:02 +0200https://ask.libreoffice.org/en/question/92772/countif-with-multiplication/?answer=92774#post-id-92774Comment by bayindirh for <p>See <a href="https://help.libreoffice.org/index.php?title=Calc/Subtotals&Language=en-US&System=WIN&Version=5.3#bm_id3154515">Data - Subtotals</a></p>
<p><img alt="SubTotals" src="/upfiles/14921607456596018.gif"></p>
https://ask.libreoffice.org/en/question/92772/countif-with-multiplication/?comment=92777#post-id-92777Wow, that's pretty interesting. Thanks. Can I move totals to another place? If I want to create a small table with it, for example?Fri, 14 Apr 2017 12:34:27 +0200https://ask.libreoffice.org/en/question/92772/countif-with-multiplication/?comment=92777#post-id-92777Answer by bayindirh for <p>I'm trying to create a spreadsheet for counting various items of same type.</p>
<p>I have two columns. One is <code>color</code>, the other is <code>count</code>. I may have many rows containing the same value for color (e.g. Blue), I also have a count column, which shows how many items that I have for the same row (e.g. 3). So while counting instead of adding <code>1</code> for each row, I want to add <code>count</code> amount to the total sum for that color.</p>
<p>e.g. If a row contains Blue as <code>color</code> and 3 as <code>count</code>, I want to add <code>3</code> to the total number of blues.</p>
https://ask.libreoffice.org/en/question/92772/countif-with-multiplication/?answer=92778#post-id-92778I've found that SUMIF also did what I looked for. I gave the color values for condition, and the counts for sum range.Fri, 14 Apr 2017 12:37:09 +0200https://ask.libreoffice.org/en/question/92772/countif-with-multiplication/?answer=92778#post-id-92778