# Google Sheets: Making a function to find a number and impute it once

I am trying to make it possible to find the highest number under 30, and than place it in another cell. Then that cell will not change when another number becomes higher. For example if the highest number is 24, then it will put that number in a cell, But if 26 becomes the highest number, the cell with 24 will not change. Have any idea for how I make this work?

• Welcome to Web Applications Stack Exchange. Jun 14 at 8:59
• Jun 14 at 9:00
• Hi, welcome to WebApps. Have you thought about the sequence of steps to do this? It's probably something like #1=`getValues` from the relevant Column and convert to a 1D array; #2= `filter` to eliminate values >= 30; #3= `Math.max()` (Doc ref) to get the highest value; #4: `setValue` to save. How are your scripts skills? Have you tried to write some code? Jun 25 at 3:37
• Your question addresses some broad issues, but lacks the detail of a working scenario. For example, how is this calculation to be initiated, where are the various highest values are to be saved, and so on. Factors such as these are essential to the design of a working solution. Would you please provide additional detail to describe the scenario in more detail and provide more specific requirements for your function. Jun 25 at 3:58