Get a cell value from two different cells - google-sheets

I have been trying to find out how to get a cell value based on two other cells. The formula I'm using is:
=ARRAYFORMULA(IF(NOT(ISBLANK(C3)),
IF(C3="","",
IF((C3-NOW())>0, "Call restaurant in "&ROUND(C3-NOW(),2)&" days",
"Call now")),))
Is it possible to add a formula that will detect if there is text in the cell in column V as indicated in green below? The message will be "do not call" else if the cell is empty the message will be "call restaurant in" or "call now" based on the left time.

If I'm understanding correctly, just add another layer to your IF statement. Note sure why the second condition is there (if it's not blank, then if it is blank, return blank...), but will leave it in the suggestion below under the assumption that it is there for a reason.
In Excel:
=IF(NOT(ISBLANK(C3)),
IF(C3="","",
IF(V3<>"", "do not call",
IF((C3-NOW())>0, "Call restaurant in "&ROUND(C3-NOW(),2)&" days",
"Call now"))))

Related

If value does not match in a cell then show it in another cell

I have a Google Sheet in which there are multiple codes. In one cell there is more than one code and in the other cell, the decision selected by the user is followed by the code.
Responses are fixed for the given codes.
I want the sheet to show if the codes selected by the users are wrong or correct in another column (if correct then leave the cell blank else to show the code selected by the user i.e the wrong code).
The conditions are:
Case 1: if the code displayed in column A is either "P" or "W" then the user's decision (column B) should be either "NO" or "YES" and the code (column C) selected by the user should be either "N" (if the decision is "NO") or "R" (if the decision is "YES") then in column D if the decision and code matches then leave the cell blank else to show the wrong code selected by the user.
Case 2: if the code displayed in column A does not have "P" or "W" code in the cell then the user's decision (column B) should be "NO" and the code (column C) selected by the user should be "IM" then in column D if the decision and code matches then leave the cell blank else to show the wrong code selected by the user. (P.S.: this condition can be created in another column).
I'm sharing a screenshot for reference. I searched for a formula but nothing worked.
Thank you.
You may try:
=indeX(lambda(regX,if(len(A2:A),
IF((regX*(B2:B="NO")*(C2:C="N"))+
(regX*(B2:B="YES")*(C2:C="R"))+
(not(regX)*(B2:B="NO")*(C2:C="IM")),,C2:C),))
(regexmatch(A2:A,"\b(P|W)\b")))

I want to find a value from one cell, and if found print the contents of another cell in the same Row

Let's say Cell L:23 contains a certain value I search for. If the Value is found, I want it to print the Contents of a Cell Horizontal to it, say D:23, in a Cell I Choose.
How could this be accomplished?
In cell D23, I would use the formula: =IF(ISERROR(SEARCH("search_value", L23)),"Not Found",L23)
In short, this means that if the substring "search_value" is found in cell L23, print the content in L23; else print "Not Found".
In its entirety, it's saying if the SEARCH() query had found a match and doesn't return an error, the ISERROR() function it's wrapped in will return false, therefore it will print L23.

Only show the first 10 characters in Google Spreadsheet cell followed by continuation character

I often have lots of data in spreadsheet cells but I don't necessarily want all the text to show in the cell as long as I can edit it in the formula bar.
So, for instance, I'd like to have the text "this text is a long sentence" in a cell but only display "this text is..." but if I click on the cell, the whole content displays in the formula bar so I can edit it.
I know that this relies on custom display formats but I can't find a way of making this work. There doesn't seem to be a placeholder for a single character, only the whole string (#).
EDIT
This is a link to the sheet ...
https://docs.google.com/spreadsheets/d/1Ahi1CsGAiD02tvAmKuQAKnNemyYdh6AUb1GcrwZCubI/edit#gid=2014979721
... this is a mock up of what I'd like to see in the cell.
Can anyone help?

How do I format a cell, only when it's not empty, based on the input of another cell?

I'm working on a spreadsheet in Google Sheets for multiple people, and indicate in a column who the person the information on that row pertains to. I want to format cells on that column, only when they're not empty, based on what person is selected in another cell.
I can create functions to format things based on another cell's entry, but I don't know how to compound that with a function for not being empty. Sorry if this is super basic, I just can't figure it out.
Yep. This is a super simple thing to do.
1) Highlight the column where the person's name appears.
2) From the main menu, select Format, Conditional formatting.
3) In the sidebar click add a new rule. what you want to do is create one rule for each name that appears (or could appear) in that column.
4) Under "Format cells if, select "Text is exactly"
5) Type the name in the cell where it says Value or Formula
6) Choose a background colour to suit.
7) Click Done.
8) Repeat steps 3 to 7 for each person; but change the background colour in each case.
Here's an example.

How to dynamically set tab name in a formula?

I have a summary tab and multiple other tabs which are constructed the same way. I would like in my summary tab to gather information from all other tabs
Today, in the summary tab I have for each line:
first cell: My tab 1 -> name of a tab in the same spreadsheet
second cell: =COUNTIF('My tab 1'!$B7:$B; "OK") -> count of all cells with "OK" text in column B.
I would like to use the tab name defined in the first cell inside the formula of the second cell. Is it possible and, if yes, how?
Try the INDIRECT function, described here: https://support.google.com/docs/answer/3093377?hl=en
=INDIRECT($A$1)
In order to be seen as a reference for the range, INDIRECT needs the entire range reference as a single string, it seems. This gives you something like the answer to your question:
=COUNTIF(INDIRECT(CONCATENATE($A$1, "!$B7:$B")), "OK")
What you give up there is that the $B7:$B portion of your address is now a string, so if you copy this cell down the page, the 7 won't get updated to 8, 9, and so on.
There may be other combinations of functions that will get you closer: this is the one I arrived at with a few minutes of searching.
shorter solution:
=COUNTIF(INDIRECT($A$1&"!B7:B"), "OK")
and for dragging it would be:
=COUNTIF(INDIRECT($A$1&"!B"&ROW(B7)&":B"), "OK")

Resources