

So the formula should be modified for these cells.

But for cells A2, A3, and A4 this formula cannot work. This formula can work from cell A5, above cell A5, there are 3 cells. I think you have got the whole concept of how this algorithm is going to work.Say for cell reference A8, I can write the formula like this: =OR(OFFSET(A8, 0, 0, 4, 1)-OFFSET(A8, -3, 0, 4, 1)=3). What this formula will return? The first offset function of the formula will return array:, we get TRUE. We can do that easily using OFFSET function as OFFSET function returns array.Then we shall find out the difference of the arrays if any of the differences is equal to 3 that the reference cell will be TRUE valued. For a reference point (like A8 or A14), we shall take a total of 7 cells around it (including the reference point) and place them side by side in the formula creating arrays. Before building the common formula, I shall show what the formulas will be for the cells A8 and A14 and then will modify the formula to make it common for all. So let’s build the algorithm with the above pattern keeping in mind.But for the second part, there is no such pattern. From the first part, you can find a pattern from the image. You will get an imaginary picture like the following. Reference cells are A8 and A14 and I am taking a total of 7 cells around the reference cell. Imagine I am taking the values of cell ranges A5: A8 & A8: A11, and A11: A14 & A14: A17 side by side.If you are used to Excel formulas, then you can smell the OFFSET function, as OFFSET function works with reference points. In cell A8 and A14, the values are 10 and 20 respectively (above image). To make you understand the algorithm easily, I will explain the whole thing with two reference cells: cell A8 and A14.Let me show you the algorithm to solve the above problem: You can apply this technique to any loop related Excel formulas.
Who created solver for excel how to#
The motto is: how to make a loop in Excel using 3 Excel functions: OFFSET, MAX, and MIN. My motto to write this post is not to show you how to solve the above problem. Now click OK two times, you’re done! You get the cells conditionally formatted like the following image.Now select the appropriate format type by clicking on the Format… button in the dialog box.

