简体   繁体   中英

Add cells based on similar cell value

I'm having a bit of a problem with my spreadsheet. I want to cells on Column L based on Column B. Column is Total while Columns B is the order number.

Here's what it looks like but it's longer I just screenshot the first 4 cells:

1

I want to add the cells in Column L if their corresponding cells in Column B match. Here's the formula I'm using.

SUMIF($B$2:$B$528,B2,$L$2:$L$528)

It's now working but I don't need the same answer for the same order ID's. For example with order #1745. I don't need to have the total for on both M3 and M4. If the order has already been totaled, I need it to skip to the next order number.

Is there a way to do this?

I found the answer. What I did was search for the string that counts my order as number 1. ie #1745 - 1 then adding the sumif formula to it.

Here's what it looks like:

=IF(ISNUMBER(FIND(" - 1",A2)),SUMIF($B$2:$B$528,B2,$L$2:$L$528),"")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM