最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

excel - How to write a formula to adjust initial starting value based on multiple if statements - Stack Overflow

programmeradmin2浏览0评论

I've added a picture to help understand what I'm trying to do. I'm trying to figure out how to have a starting value (cell B3:B11) per category (cell A3:A11) that adjusts the indicated amount (cell D15:D23) based on the From (cell B15:B23) and To (cell C15:C23). The TOP of the image attached shows my starting and the BOTTOM of the image attached shows what it should look like at the end automatically.

So far I had figured out how to sumif by looking in Column C (Destination) to get a positive accumulation, but not really sure how to get a subtraction/minus value by looking in Column B (Origination) =SUMIF(B16:B23,"B",D16:D23)+SUMIF(C16:C23,"B",D16:D23)

Many thanks in advance.

I've added a picture to help understand what I'm trying to do. I'm trying to figure out how to have a starting value (cell B3:B11) per category (cell A3:A11) that adjusts the indicated amount (cell D15:D23) based on the From (cell B15:B23) and To (cell C15:C23). The TOP of the image attached shows my starting and the BOTTOM of the image attached shows what it should look like at the end automatically.

So far I had figured out how to sumif by looking in Column C (Destination) to get a positive accumulation, but not really sure how to get a subtraction/minus value by looking in Column B (Origination) =SUMIF(B16:B23,"B",D16:D23)+SUMIF(C16:C23,"B",D16:D23)

Many thanks in advance.

Share Improve this question edited 2 days ago cpht asked 2 days ago cphtcpht 991 gold badge3 silver badges10 bronze badges 0
Add a comment  | 

1 Answer 1

Reset to default 0

Try pasting the following formula into cell D3 and dragging the fill handle down:

=SUMIFS(D$16:D$23,C$16:C$23,A3)-SUMIFS(D$16:D$23,B$16:B$23,A3)

If you are using the 365 version of Excel you could modify the formula as follows, and it will spill down:

=SUMIFS(D16:D23,C16:C23,A3:A11)-SUMIFS(D16:D23,B16:B23,A3:A11)

发布评论

评论列表(0)

  1. 暂无评论