Home > Mobile >  How to execute the function only when there is a specific value in another column
How to execute the function only when there is a specific value in another column

Time:10-11

Dear StackOverFlow users,

I would love to create a function that will do the calculation based on the specific value in another column.

enter image description here

Example xls is here:

https://docs.google.com/spreadsheets/d/1y6d0_0x_8aooy9iYfc9HtspwBpN6k5mJV5TKeOsnjcQ/edit?usp=sharing

CodePudding user response:

use IF:

=IF(C3="Dividend"; SUBSTITUTE(
 IMPORTXML("https://finviz.com/quote.ashx?t="&A3; 'XML IMPORT'!C$3); "."; ",")/4; "-")

array would be:

={"DIVIDEND";INDEX(MAP(C2:C; A2:A; LAMBDA(c; a; IF(c="Dividend"; SUBSTITUTE(
 IMPORTXML("https://finviz.com/quote.ashx?t="&a; 'XML IMPORT'!C$3); "."; ",")/4; "-"))))}
  • Related