I need an action in the shape context menu to be enabled only when there is at least one hyperlink (the "Hyperlinks" section is non-empty).
Is there a formula for this?
If you mean a formula for testing if there are any hyperlinks try:
If (vsoShape.RowCount(visSectionHyperlink) > 0) Then
'Code to enable context menu
End If
Related
I have a list of recipe, and I also have a list of sold menu. Is there any way that can filter the recipe (can be with query, or not) by looking at the menu (that can repeat more than once)?
https://docs.google.com/spreadsheets/d/1Ire32u7kELCAu07AHiTGt8yoXwCWDpvT77nQYSN21DU/edit#gid=0
This is the sample case
A2:B7 is the list of recipe
D2:D7 is the list of menu sold
F2:F13 is the desired result
Arrayformula is preferred since I don't have to drag down again when the data set get bigger.
try:
=FLATTEN(BYROW(D2:D7, LAMBDA(x, TRANSPOSE(FILTER(A2:A7, B2:B7=x)))))
In case you have unmatching amount of items per menu (I added two extra elements to tenderloin), you can try this other option so you don't have empty spaces:
=TRANSPOSE(SPLIT(JOIN(",",BYROW(D2:D,LAMBDA(r,IF(r="",,JOIN(",",FILTER(A2:A, B2:B=r)))))),","))
Another solution using REDUCE:
=REDUCE("recipe used",D2:D10,LAMBDA(a,c,{a;FILTER(A2:A10,B2:B10=c)}))
Want to ask if there's a quick way, an automated or using formulas for this scenario.
So I have "config" sheet, and each columns is a list used for a specific dropdown.
config!A:A = clientA
config!B:B = clientB
In a "summary" sheet, I need to add a dropdown in column C depending on the column A
For example summary!A2 contains "client A" so the dropdown in summary!C2 will show the list of clientA
And summary!A3 contains "client B" so the dropdown in summary!C3 will show the list of clientB
What I currently do is named the range each in the "config" then in "summary" I put the Data Validation for the specific name.
I was wondering if there's a custom formula that I can put in the Data Validation for Column C that depends on the value in column A. The only challenge is there are spaces so in the Named Range I remove the space. And since it depends on the column, the row number is moving.
Looking for a formula since I am avoiding App Script for this specific file. Thanks
Hopefully someone could help me on this.
Thanks much.
You are all awesome!
What you can do is set an Auxiliary sheet (or extra columns far in "Summary"). You can set Summary!C2 the next Data Validation:
=Auxiliary!A1:1
Open the settings of that data validation and make sure there are no anchors (no $, for example A$1). If there is some, delete them
Close it and then copy and paste special - Data Validation only to the rest of the cells
This way C2 will be associated with row 2 from Auxiliary, C3 with row 3 and so on
Then, you can go to Auxiliary and set a formula in each row to filter the values according to B2, B3 (or however you identify the client... (a Query, or Filter) --> You'll probably need to transpose the information, so the list becomes a row
With that done, each data validation will depend now on the value of that row
Re-reading your example, you can do the same but instead of filter you can transpose the entire Config sheet and you'll have a row per client
......
You have an example here: https://docs.google.com/spreadsheets/d/1jF5XoBkQll5tHEjADg508NMznmbuB43tyWv5R2S1mM8/edit?usp=sharing
I have 2 documents:
Document 1 contains a list with so called Set-names, displayed as "Set". And within each "Set" there is name that can be found that corresponds to the number within that set.
Document 2 contains all the Set-names with each their own numbers and Name. Each Set-name has it's own Sheet, and there is a lot of them.
I want to fill in just the Set-name "Set" and Set-number "Set#", to automatically display the name corresponding to these two values. The question is however, how do I do that?
Document 1: Collection
Shared document link: Click here (File > Make copy)
Document 2: All Set-names
Shared document link: Click here (File > Make copy)
In this example above I would like to output "Dark Raichu" within Document 1 at Q74:T74 and at Q75:T75. Is this even possible to make? INDIRECT might help as well so I don't have to manually edit each Set-name. Any idea/suggestion/solution is much appreciated!
EDIT
(following OP's explanations)
First of all I have to say that you should AVOID making such radical changes to the original question, since it completely throws readers off balance.
Having said that there is a completely different approach that should be followed.
In your Document 2: All Set-names
Step 1
Go to your Wizards Black Star Promos tab.
Using a formula like =ArrayFormula(A4:A59&"/555")
change the Set # from 1,2,3...59 to 1/555,2/555,3/555...59/555
(555 can be any unique number that does NOT conflict with the other sets)
Step 2
Create a new tab. Name this tab AllSets
Step 3
Use this formula in cell A2
={FILTER('Base Set'!A5:C,'Base Set'!A5:A<>"");
FILTER(Fossil!A5:C,Fossil!A5:A<>"");
FILTER('Base Set 2'!A5:C,'Base Set 2'!A5:A<>"");
FILTER('Wizards Black Star Promos'!A5:C,'Wizards Black Star Promos'!A5:A<>"");
FILTER(Jungle!A5:C,Jungle!A5:A<>"")}
Using this pattern complete the formula for the rest of your tabs. You will end up with a 3 columns list of all your sets in one place.
In your Document 1: Collection
Step 4
Go to your Collection tab.
In cell Q2 (where column Q is exactly before your Name column R) use the following formula.
(As before, complete the formula for the rest of your tabs)
=INDEX(IFERROR(N2:N&(SWITCH(H2:H,
"Base Set","/96",
"Jungle","/64",
"Wizards Black Star Promos","/555",
"Fossil","/62"))))
This way you will bring the complete Set # back.
This will be our helper column which can be hidden and will be only used in the next formula.
Step 5
In the same Collection tab and in cell R2 place this formula
=ArrayFormula(IFERROR(
VLOOKUP(Q2:Q,IMPORTRANGE("1n8iWAl7ZQhsue6Opefvh_9yDwMk06PvqUdQoVuEJw00","AllSets!A2:C"),{2,3},0)))
The above final formula will give you everything.
The Card name, the Type as well as the Link and the Image of the card.
If you do not want the Type just change this part of the formula {2,3} to just 2.
Step 6
Enjoy :)
Additional functions used:
FILTER
INDEX
SWITCH
Original answer
(For the question as originally posted )
You can use a combination formula like
=ArrayFormula(IFERROR(
VLOOKUP(V2:V,{REGEXEXTRACT(Sheet1!R2:R,"\d+")*1,Sheet1!S2:S},2,0)))
(do adjust ranges and locale syntax to meet your needs)
Functions used:
ArrayFormula
IFERROR
VLOOKUP
REGEXEXTRACT
You can easily import a range from one Spreadsheet to another using IMPORTRANGE. IN your case described as you wanted to import the range A5:A (i.e all cells in column A minus the first 5 cells in the column) of the sheet Team Rocket of the Spreadsheet Document 2 into Document 1 cell Q73 you would need to use this function in cell Q73:
=IMPORTRANGE("YOUR DOCUMENT 2 SPREADSHEET URL","Team Rocket!A5:A")
Note that when you first use this function it might ask you to grant access between these Spreadsheeets to let one get the data from the other
I have a drop-down list which change depending on another cell so if the other cell is set to no my other cell should have in a data validation range only stand-by if it's set to yes it should then have: real,phone,both everything works but...
my problem is that now I want to have a hundred others row in my array so I tried to extend the array but the data validation doesn't update. So I'd have to manually change one-by-one every data-validation cell.
Here is my sheet in the picture:
https://imgur.com/a/56Nk1SG (I've put a description on each image to make it more understandable).
notice: I know that in excel if I extend the array the data-validation works so I tried to extend it save it and then import it to google-sheets but it didn't work...and in excel there is no checkbox and some formula doesn't work so I've to keep it in google-sheets
edit: I know there is another post similar but it's not the same problem...
In my opinion the best way to achieve that is via VBA.
Steps:
Import "Yes" options in Range("A1:A4"). Range("A1") includes Yes as a header.
Select Range("A1:A4").
Home - Styles Tab - Format as Table - Select Light - Check range & Check "My table has headers".
Select "Yes" table - Design - Table Name: tblYes.
Import "No" options in Range("B1:B2"). Range("B1") includes No as a header.
Select Range("B1:B2").
Home - Styles Tab - Format as Table - Select Light - Check range & Check "My table has headers".
Select "No" table - Design - Table Name: tblNo.
Open VBA Editor. (Press ALT an then F11).
Double click on the sheet you want conditional formatting (from the box on the left up part of the page).
Select Worksheet from the left box above the code box.
Select Change from the right box above the code box.
Insert the below code and try.
Code:
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
With ThisWorkbook.Worksheets("Sheet1") '<- Change sheet name if needed
If Not Intersect(Target, .Range("E1:E10")) Is Nothing And Target.Count = 1 Then '<- Change range if needed. Check if the change included in our range.
Application.EnableEvents = False
If Target.Value = "Yes" Or Target.Value = "No" Then '<- Case sensitive. Check the value insert if it is Yes or No
With .Cells(Target.Row, "F").Validation
.Delete '<- Clear previous valitation
If Target.Value = "Yes" Then '<- Check if the answer if Yes
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=INDIRECT(""tblYes[Yes]"")"
ElseIf Target.Value = "No" Then '<- Check if the answer if No
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=INDIRECT(""tblNo[No]"")"
End If
End With
Else '<- If the value insert is NOT Yes or No
.Cells(Target.Row, "F").Clear '<- Clear format & contents next to change cell
MsgBox "Insert Yes or No!" '<- Message box prompt for Yes or No
End If
Application.EnableEvents = True
End If
End With
End Sub
Sheet image including tblYes & tblNo:
VBA Editor image:
I have an table in an MS Excel 2010. The table has two columns. The first column is a name of a person (Col A), the second column is the marks that the person secured in an exam (Col B).
I am applying conditional formatting. If I choose the following wizard
Home > Conditional Formatting > Format all cells based on their values
I can color the Col B on a 3-color scale. This is exactly what I want. However, I want it for the entire row and not only the cell in Col B. I want the name also to be formatted in the same color as the marks.
Anyone knows how to do this?
I have already looked around a bit. The following came close to did not solve the particular problem that I am trying to.
http://www.howtogeek.com/howto/45670/how-to-highlight-a-row-in-excel-using-conditional-formatting/
Conditional Formatting Rows Based on Date
You're probably going to have to use VBA code for this.
Right click the worksheet label and select 'View Code'
Inside the code window, paste in the following code:
Sub RunMe()
Dim xRng As Range, xCell As Range
With Me
Set xRng = .Range(.Cells(2, 2), .Cells(.Rows.Count, 2).End(xlUp))
' Change the first '2' above to reflect the starting row of your data
For Each xCell In xRng
xCell.Offset(0, -1).Interior.Color = xCell.DisplayFormat.Interior.Color
Next xCell
End With
End Sub
Now every time you run the macro (Alt-F8, select macro), column A will be formatted with the conditional formatting assigned to column B.
If you want this process to be automatic, change:
Sub RunMe()
to something like:
Private Sub Worksheet_Activate()
' This will run the macro whenever the worksheet is selected
or you could assign the code to a keyboard shortcut or a command button etc.
If you would like the code to run every time the file is opened, saved closed etc, add the code instead to the ThisWorkbook code window (although you'd have to alter the code slightly as 'Me' is referencing the particular worksheet in which the code is placed).