How to sum a conditional formula across multiple cells?
Hi, I'm looking for an elegant solution to this problem. Mostly just a curiosity because I currently do have it working, but I know there is a cleaner way to do this. Basically I am trying to sum the number values from a row of 5 cells, where the cell may or may not start with a letter (i.e., the row could be "8, 9, S6.5, 8, A6" and I want the result of 8+9+6.5+8+6=37.5). I have many rows of this, and the summed value ends up in the column to the right of the 5 values.
I've managed to do this with the following formula, where the result is in cell J5:
=IF(ISTEXT(E5), RIGHT(E5, LEN(E5)-1), E5) + IF(ISTEXT(F5), RIGHT(F5, LEN(F5)-1), F5) + IF(ISTEXT(G5), RIGHT(G5, LEN(G5)-1), G5) + IF(ISTEXT(H5), RIGHT(H5, LEN(H5)-1), H5) + IF(ISTEXT(I5), RIGHT(I5, LEN(I5)-1), I5) But, if I recall from years ago, there is a way to make the formula act on an array of cells using ctrl+shift+enter so the formula would essentially look like this, and do the same thing:
={SUM(IF(ISTEXT(E5:I5), RIGHT(E5:I5, LEN(E5:I5)-1), E5:I5))} Thing is, it doesn't seem to cooperate, and I have gotten pretty rusty with excel. This array formula will sum values but not if there is text in the cell.
Example data:
| M | T | W | Th | F | SUM |
|---|---|---|---|---|---|
| T8 | T8 | 9 | 9 | 5 | 39 |
| 9 | 8 | 8 | A8 | 8 | 41 |
| 8 | 8 | 8 | 8 | 8 | 40 |
| S8 | 9.5 | 8 | 8 | 6 | 39.5 |
[link] [comments]
Want to read more?
Check out the full article on the original site