Adding non sequential cells in a column

Nanaia

Active Member
Joined
Jan 11, 2018
Messages
304
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
Is there a way to add non sequential cells in a column without having to select every cell? If possible I would like to have a more concise formula to replace
Excel Formula:
=IFERROR(IF(L102<>"",IF(AND(V29-P30-P33-P36-P39-P42-P45-P48-P51-P54-P57-P60-P63-P66-P69-P72-P75-P78-P81-P84-P87-P90-P93-P96-P99>0,V29-P30-P33-P36-P39-P42-P45-P48-P51-P54-P57-P60-P63-P66-P69-P72-P75-P78-P81-P84-P87-P90-P93-P96-P99<=45),V29-P30-P33-P36-P39-P42-P45-P48-P51-P54-P57-P60-P63-P66-P69-P72-P75-P78-P81-P84-P87-P90-P93-P96-P99,IF(V29-P30-P33-P36-P39-P42-P45-P48-P51-P54-P57-P60-P63-P66-P69-P72-P75-P78-P81-P84-P87-P90-P93-P96-P99>45,45,0)),""),"")
If anyone can help it would be appreciated.
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Hi,

Do the values in Column P (e.g. P30, P33, etc.) have any identifiers in another Column (e.g. date, text, etc.) ?
 
Upvote 0
I'm not sure what you mean by identifier. The non sequential cells are a numerical value that is the result of a formula. Whole numbers, no text and 'general' formatting.
 
Upvote 0
You seem to be subtracting every third row (from P30 - P99). So you may be able to incorporate that into a formula using MOD.

For example, this whole section:
Excel Formula:
=V29-P30-P33-P36-P39-P42-P45-P48-P51-P54-P57-P60-P63-P66-P69-P72-P75-P78-P81-P84-P87-P90-P93-P96-P99
could be replaced with this:
Excel Formula:
=V29-SUMPRODUCT(--(MOD(ROW(P30:P99),3)=0),P30:P99)

So you should be able to re-use that logic for the other sections of your formula.
 
Upvote 0
Solution
I'm not sure what you mean by identifier. The non sequential cells are a numerical value that is the result of a formula. Whole numbers, no text and 'general' formatting.

What I mean is this:

Book3.xlsx
OP
1Apple1
2Orange2
3Pear3
4Apple4
5Orange5
6Pear6
7Apple7
8Orange8
9Pear9
10Apple10
Sheet980
 
Upvote 0
Since you also seem to be doing the same calculation over-and-over again, I think you may be able to use the new LET function.
I have seen them done, but unfortunately, I have not really played around with them yet.
 
Upvote 0
OK, I just messed around with the LET function for the first time (it was easier than I thought), and I think your whole formula can be replaced with this:
Excel Formula:
=LET(temp,V29-SUMPRODUCT(--(MOD(ROW(P30:P99),3)=0),P30:P99),IFERROR(IF(L102<>"",IF(AND(temp>0,temp<=45),temp,IF(temp>45,45,0)),""),""))
 
Upvote 0
@jtakw Thank you. That seems to work.
@Joe4 Thank you also. Your formula seems to also work. I will test both of them to determine if one suits the situation better.
What I'm doing is breaking down a user entered number into segments of not more than 45. So every cell listed is the previous segment of 45 subtracted from the total until the result is zero. It's a pain to do it with pen and paper or calculator so thought this would help my coworkers.
Thank you for your help.
 
Upvote 0

Forum statistics

Threads
1,203,605
Messages
6,056,269
Members
444,853
Latest member
sam69

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top