2 min readfrom Microsoft Excel | Help & Support with your Formula, Macro, and VBA problems | A Reddit Community

How to sum a conditional formula across multiple cells?

Our take

If you’re looking to sum values from a row of cells that may include text, there’s an elegant solution to streamline your formula. Instead of using multiple IF statements, you can leverage an array formula that processes the entire range at once. This method not only simplifies your formula but also enhances readability. By using a combination of SUM and IF functions within an array formula, you can effectively sum numeric values while ignoring any text, making your spreadsheet more efficient.

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
submitted by /u/ganduvo
[link] [comments]

Read on the original site

Open the publisher's page for the full experience

View original article

Related Articles

Tagged with

#AI formula generation techniques#formula generator#Excel alternatives for data analysis#financial modeling with spreadsheets#rows.com#generative AI for data analysis#Excel compatibility#row zero#no-code spreadsheet solutions#Excel alternatives#natural language processing for spreadsheets#big data management in spreadsheets#conversational data analysis#real-time data collaboration#intelligent data visualization#data visualization tools#enterprise data management#big data performance#data analysis tools#data cleaning solutions