Cómo utilizar la fórmula CHOOSE en Google Sheets

We may already be aware of the usability of the nested IF statements and INTERRUPTORformulas in Google Sheets. Going by the experience, we can conclude that the SWITCH formula is less complicated than that of the nested IF statement. On the similar lines, wouldn’t it be nice if instead of specifying the case every time, we just specify an index of sorts, and we get the corresponding value? Well, just to help us with that purpose, the Google Sheets application hosts the CHOOSE fórmula.

Sintaxis

CHOOSE(index, choice1, [choice2, …])

  • índice – this specifies the choice number. If it is 1, the CHOOSE formula returns the choice1. Similarly, if it is 3, we get choice3 in return. Please note that the Google Sheets allows up to 30 index values, starting from 1.
  • choice1 – the formula returns this when the index value is 1. It can be a simple text, number, reference to another cell, or even a full-fledged formula.
  • choice2 – additional and optional parameters similar to that of choice1.

Usage: CHOOSE Formula

Let us start with the basic example that returns the weekday based on the index number. In the snapshot below, you can see the various combinations of the formula that we tried.

CHOOSE formula 1

Like we mentioned above, the range of the index values can only start from 1 and can’t exceed the total number of choices within the formula. What happens if we try to force that? It coughs up errors of course! Let us try that firsthand. Below is the snapshot that demonstrates the outcome of using the index value 0.

CHOOSE formula 2

Does the behavior change when we exceed the number of choices (in this case 3)? As it turns out, not really.

CHOOSE formula 3

Similar is the case when the index number is either a negative number.

CHOOSE formula 4

What happens if the index is a decimal number? Surprisingly, it doesn’t error out this time. The CHOOSE formula considers the value on the left of the decimal point (in this case 2) and evaluates the formula accordingly.

CHOOSE formula 5

También te puede gustar...

funciones y fórmulas de google sheets

Cómo hallar el tipo de interés nominal con Google Sheets

Sarah es una joven profesional que toma importantes decisiones financieras. Desde tarjetas de crédito a hipotecas, préstamos estudiantiles e inversiones...
funciones y fórmulas de google sheets

Extraer datos de Google Calendar en Google Sheets mediante Apps Script

Este post fue publicado originalmente en nuestro foro de la comunidad. Objetivo : Esta guía muestra cómo utilizar Google Apps Script para extraer datos...
funciones y fórmulas de google sheets

Uso de la función PROPER para escribir en mayúsculas la primera letra de cada palabra en Google Sheets

Nota: Este artículo se publicó originalmente en el foro de nuestra comunidad. Alguna vez te has visto en la necesidad de limpiar una lista de nombres, títulos o cualquier...