只有在“x”时才能添加值存在? [英] How can I add values only if "x" is present?

查看:126
本文介绍了只有在“x”时才能添加值存在?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在努力向我们的图书馆添加一组棋盘游戏。



我有一个电子表格,列出比我打算购买的游戏数量多,但要在那里进行调查。我在每场比赛旁边列出几个网站的价格。



问题是我想要一个不包括列表中每个游戏的总和。相反,我想在前面添加一个列,如果我放一个X表示这是一个游戏,那么我想要添加它的值。只有列A中以X开头的行的值才会添加在一起,而不是所有内容。



我希望通过一个公式来做,而不是选择一个基本的 = SUM 公式,只选择一个一次只有几个细胞。我假设一个 = SUMIF 可能是答案,但我还没有弄清楚如何让它工作。

解决方案

请尝试:

  = SUMIF(A:A,x,B:B)

其中B:B是具有值的列。我怀疑你的困难可能是,当使用文本作为触发器时,需要使用双反转逗号。或者您可以按ColumnA排序,只需使用= SUM尽可能远,因为 x s。或者对ColumnA进行过滤以选择 x 和Autosum ColumnB,但更改 9



code>到 109


I'm working on adding a collection of board games to our library.

I have a spreadsheet that lists more games than I intend to buy, but have them there to investigate. I have the prices for a couple of websites listed beside each game.

The problem is that I want a sum that doesn't include every game on the list. Instead, I want to add a column at the front that if I put an "X" indicating this is a game to get, then I want it to add the value for that. Only the values for rows that start with an "X" in column A will in added together, instead of everything.

I was hoping to do this with a formula instead of just choosing a basic =SUM formula and selecting only a few cells at a time. I assume a =SUMIF might be the answer, but I have yet to figure out how to get this to work.

解决方案

Please try:

=SUMIF(A:A,"x",B:B)  

where B:B is the column with the values. I suspect your difficulty may have been that when using text as the 'trigger' it needs to be in double inverted commas.

Or you might sort by ColumnA and just use =SUM as far down as there are xs.

Or filter on ColumnA to select x and Autosum ColumnB but change the 9 to 109.

这篇关于只有在“x”时才能添加值存在?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆