# Excel question

**URL:** <https://boards.straightdope.com/t/excel-question/556458>\
**Category:** Factual Questions\
**Created:** [October 8, 2010, 3:54am UTC](https://boards.straightdope.com/t/excel-question/556458 "2010-10-08T03:54:56Z")\
**Posts on this page:** 3\
**Page:** 2

<div class="post-metadata">

**Author:** ![FasterThanMeerkats](https://avatars.discourse-cdn.com/v4/letter/f/278dde/32.png) [@FasterThanMeerkats](https://boards.straightdope.com/u/FasterThanMeerkats)\
**Post date:** [October 11, 2010, 1:08pm UTC](https://boards.straightdope.com/t/excel-question/556458/21 "2010-10-11T13:08:17Z")

</div>

> [@amarone](#):
>
> If each column has a header of QTY or COST, as shown in the example, there is a much easier way: The following is a solution for four QTY/COST pairs, beginning in B2 and ending in I2.
> 
> =SUMIF(B$2:I$2,“QTY”,B3:I3)  
> =SUMIF(B$2:I$2,“COST”,B3:I3)
> 
> These can be copied down the rows and B3:I3 will automatically change to each row to which it is copied.

Seconded. Sumifs like this are extremely useful and this one won’t require you to change your structure.

---

<div class="post-metadata">

**Author:** ![Gary\_Robson](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/gary_robson/32/3448_2.png) [@Gary\_Robson](https://boards.straightdope.com/u/Gary_Robson)\
**Post date:** [October 11, 2010, 5:43pm UTC](https://boards.straightdope.com/t/excel-question/556458/22 "2010-10-11T17:43:13Z")

</div>

I must have been well and truly addled to have missed this solution. I use sumif all the time and somehow never thought of it for this. Thanks.

---

<div class="post-metadata">

**Author:** ![MandaJo](https://avatars.discourse-cdn.com/v4/letter/m/ac91a4/32.png) [@MandaJo](https://boards.straightdope.com/u/MandaJo)\
**Post date:** [October 11, 2010, 6:05pm UTC](https://boards.straightdope.com/t/excel-question/556458/23 "2010-10-11T18:05:23Z")

</div>

> [@Munch](#):
>
> Not to beat a dead horse, but merely to spread the good word - learn how to do a pivot chart. It will expand your Excel utilization far beyond that of any other task/formula available.

My mother is one of 12 geeky, geeky children. This point was really driven home when a family get together turned into a spontaneous pivot table workshop.

[Previous page](https://boards.straightdope.com/t/excel-question/556458.md?page=1)
