# Thread: Subtraction of cells in alternating ranges Thanks: 0 Likes: 0

1. ## Subtraction of cells in alternating ranges

Hello,

I am looking for a solution preferably with formulas or in vba.

Need something to be able to calculate the cycle times in column 8 below by subtracting the finish time from the start time for each cycle.
The cycles vary in cell row ranges so I'm not sure how to go about this. Thought of using count blanks formula but can't figure it out.
Help appreciated.

[IMG] [/IMG]  Reply With Quote

2. ## Re: Subtraction of cells in alternating ranges

Hi. Try this:

=IF(A2="finish",G2-LOOKUP(2,1/(\$A\$2:A2="start"),\$G\$2:G2),"")  Reply With Quote

3. ## Re: Subtraction of cells in alternating ranges Originally Posted by steve the fish Hi. Try this:

=IF(A2="finish",G2-LOOKUP(2,1/(\$A\$2:A2="start"),\$G\$2:G2),"")
Hi,

Thanks but this is returning a #N/A error not sure what this means.  Reply With Quote

4. ## Re: Subtraction of cells in alternating ranges

Which cell is the top left cell from that image?  Reply With Quote

5. ## Re: Subtraction of cells in alternating ranges

I see the problem now, works perfect thanks!  Reply With Quote

## User Tag List

cell, cycle, ranges, time, vary 