If statement based on multiple columns - if-statement

In google sheets, how can I write an if statement that based on multiple columns, I can get a numerical value?
I have something like below that gives me a value if Yes or No,
=IF($G502="Yes",5,0)
If I want to say if $G502 and $H502 and $I502 and $k502 are all no, give me the value of 5?
Thanks!

try:
=IF((G502="no")*(H502="no")*(I502="no")*(k502="no"), 5, 0)

Related

How can I adjust this spreadsheet formula to take a random *non-blank* value from the specified range?

I am trying to achieve a certain unusual result using Google Sheets and here's what I've got so far.
My formula takes the value of a randomly selected cell within the named range "IntroLines":
=INDEX(IntroLines,RANDBETWEEN(1,ROWS(IntroLines)),1)
The only problem with it is that some of the cells in that named range are blank and I would like NOT to select those cells. Any ideas how I could update this formula to enforce that a non-blank value is selected?
Note: I would strongly prefer to solve this problem without removing blank cells from the named range.
Try:
=INDEX(SORT(IF(IntroLines="",,{IntroLines, RANDARRAY(ROWS(IntroLines))}), 2, 1), 1, 1)

IF Statement to return a value based on two cells in sheets/excel with colour formatting

Hi I'm struggling with the correct IF statement to look at the impact and effort columns and assign the correct category Value with colour which I will need to copy through a massive list. Just cant seem to get it right and on a couple of deadlines.
use in C2:
=INDEX(IFNA(VLOOKUP(A2:A&B2:B, {F2:F&E2:E, G2:G}, 2, 0)))

ArrayFormula with IF Google Sheets

I am trying to write an auto-expanding formula that tests if a value exists Stakeholders/Communities in column D on sheet Elements if it does write Yes in not write No
I have tried various thing, like
=ArrayFormula(IF(INDIRECT(Elements!D2:D="Stakeholders/Communities"),"Yes","No"))
But not getting it
try:
=ARRAYFORMULA(IF(INDIRECT("Elements!D2:D")="Stakeholders/Communities", "Yes", "No"))

Use of IF function in google spread sheet for arrays

I am trying to understand to use properly the IF function in Google Sheets for an array of cells. My problem is the following:
I want to sum some data in a row, let's say from D12 to N14, but I want to check if any of the cells is empty with the function ISBLANK and to show a result if and only if at least one cell in the range is not empty.
Hence I used the formula =IF(ARRAYFORMULA(ISBLANK(C14:N14));; SUM(C14:N14)). Unfortunately, the result is not what I expected. For instance, if the second cell is not empty and the first cell is empty it does not perform the sum. It seems that the function ISBLANK checks only the first cell.
So the question is: How can I use in a more proper way the above functions?
do this:
=IFERROR(1/(1/SUM(C14:N14)),"")
try:
=ARRAYFORMULA(IF(COUNTA(C12:N14)=0;; SUM(C12:N14)))
or like this:
=REGEXREPLACE(""&SUM(C12:N14); "^0$"; )*1

google charts wrong paint?

what is wrong with ratio? (100,200)
https://chart.googleapis.com/chart?cht=p&chd=t:100,200&chs=300x120&chl=Hello|World
As marcog explained, by default values over 100 will be truncated to 100, thus causing your api call to be processed in the background as:
https://chart.googleapis.com/chart?cht=p&chd=t:100,100&chs=300x120&chl=Hello|World
which is why you see a pie chart with two equal pieces. One way to fix this is to add a custom scale to your data series using the chds parameter like this:
https://chart.googleapis.com/chart?cht=p&chd=t:100,200&chds=0,200&chs=300x120&chl=Hello|World
Note I added a &chds=0,200 to specify that values can range from 0 to 200.
Another option is to use percentages rather than actual values
Hope this helps.
The values need to be between 0 and 100, with values above 100 truncated to 100 (reference).
Had a quick mess around with the URL. Is it possible there's meant to be a "total" parameter in the URL? Since 3 parameters just splits it equally into 3 parts...