A method for automated drilling of a borehole in a subsurface formation, comprising: selecting a set of at least one control variables; defining a drilling performance objective having a value that is influenced by drilling of the borehole using at least one control variable from the set of control variables; drilling a first interval of the borehole maintaining the at least one control variable at a first value; the first value being from a first set of one or more values for the set of control variables drilling a second interval of the borehole maintaining the at least one control variable at a second value; the second value being from a second set of one or more values for the set of control variables drilling a third interval of the borehole maintaining at least one of the set of control variables at a third value; characterized by the step of: selecting the third value by: applying an offset value to one of the values of the first and second sets of values, the offset value comprising a magnitude and direction; selecting the one of the first and second sets of values to which the offset value is applied by comparing the value of the drilling performance objective while drilling the first interval to a predetermined value of the drilling performance objective and comparing the value of the drilling performance objective while drilling the second interval to the predetermined value of the drilling performance objective, and, selecting the direction of the offset value based on which of the first and second sets of values is applied to produce the value of the drilling performance objective closest to the predetermined value of the drilling performance objective. selecting a set of at least one control variables; defining a drilling performance objective having a value that is influenced by drilling of the borehole using at least one control variable from the set of control variables; drilling a first interval of the borehole maintaining the at least one control variable at a first value; the first value being from a first set of one or more values for the set of control variables drilling a second interval of the borehole maintaining the at least one control variable at a second value; the second value being from a second set of one or more values for the set of control variables drilling a third interval of the borehole maintaining at least one of the set of control variables at a third value; characterized by the step of: selecting the third value by: applying an offset value to one of the values of the first and second sets of values, the offset value comprising a magnitude and direction; selecting the one of the first and second sets of values to which the offset value is applied by comparing the value of the drilling performance objective while drilling the first interval to a predetermined value of the drilling performance objective and comparing the value of the drilling performance objective while drilling the second interval to the predetermined value of the drilling performance objective, and, selecting the direction of the offset value based on which of the first and second sets of values is applied to produce the value of the drilling performance objective closest to the predetermined value of the drilling performance objective. applying an offset value to one of the values of the first and second sets of values, the offset value comprising a magnitude and direction; selecting the one of the first and second sets of values to which the offset value is applied by comparing the value of the drilling performance objective while drilling the first interval to a predetermined value of the drilling performance objective and comparing the value of the drilling performance objective while drilling the second interval to the predetermined value of the drilling performance objective, and, selecting the direction of the offset value based on which of the first and second sets of values is applied to produce the value of the drilling performance objective closest to the predetermined value of the drilling performance objective.