I need help with Google spreadsheet checkmark conditional formatting. Please see the image for a better understanding. When I click on the C2 cells checkmark then automatically A2 cells $10 will be selected and added to the E5 cells. When I click on the B6 checkmark then automatically A6 cells $40 will be selected and added to the E5 cells. Summary of the concept: When I checkmark any cells (from B2 to B9 & C2 to C9) the same row (From A column) number will be added automatically to the specific cells(to E5 cells). How do I do it?
Sheet Link (I have given edit permission, you can edit it) - Go to sheet link
try:
=INDEX(SUM(IF(B2:C9=TRUE, A2:A9, 0)))
or:
=INDEX(SUM(IF((B2:B9=TRUE)+(C2:C9=TRUE), A2:A9, 0)))
or try:
=SUMPRODUCT((B2:B9=TRUE)*(C2:C9=TRUE)*A2:A9)
=SUMPRODUCT(((B2:B9=TRUE)+(C2:C9=TRUE))*A2:A9)
Try below formula-
=QUERY(A2:C9,"select sum(A) where B=True or C=True label sum(A) ''")
Related
Statement:
IF value of 1st Google sheet cell A2 is equal to value of cell A2 of 2nd Google sheet, then copy A3 value of 2nd Google sheet into A3 of 1st Google sheet.
Thanks
try:
=IF(A2='2st Google sheet'!A2; '2nd Google sheet'!A3; )
or:
=HLOOKUP(A2; '2nd Google sheet'!A2:A3; 2; 0)
There are several methods you can try:
=IF(A2=firsSheet!A2,SecondSheet!A3)
=HLOOKUP(A2,SecondSheet!$A$2:$A$3,2,0)
=FILTER(SecondSheet!A3,A2=FirstSheet!A2)
or you can use "Index-Match" formula
I have a Google Sheet which is being populated by a Google Form. I am using Google Apps Script to add some extra functionality. Please feel free to access and modify these as needed in order to help.
Based on answers from the Form, I need to return a new date that factors in the time stamp at form submission.
This is a dumbed down example of what I need to do, but let's think of it like ordering a new car and its color determines how long it is going to take.
Car
Color
Toyota
Red
Honda
Blue
Tesla
Green
I need to write a conditional IF statement that determines how many weeks it will take to get the car based on the ordered color.
-
Red
Blue
Green
Toyota
1
3
5
Honda
2
4
6
Tesla
1
1
1
So if you order a Toyota in Red, it will take one week. If you order a Toyota in Green, it will take 5 weeks. If you order a Tesla, it will be really in one week no matter what color. Etc...
I started by writing some language in Sheets to take the Timestamp which is in Column A and add the appropriate amount of time to that:
=IFS(AND(B2 = "Toyota",C2 = "Red"),A2 + 7,AND(B2="Toyota",C2="Blue"), A2 + 21,AND(B2="Toyota",C2="Green"), A2 + 35,AND(B2 = "Honda",C2 = "Red"),A2 + 14,AND(B2="Honda",C2="Blue"), A2 + 28,AND(B2="Honda",C2="Green"), A2 + 42,AND(B2 = "Tesla"),A2 + 7)
And then I dragged that down the length of the entire column so that it would fill in as submissions came in.
However when you fill in the Google Form, it will overwrite what's in that entire row, blowing out what I had in that column.
Now I realized that the code needs to be written in Google Apps Script and returned as a value.
What kinds of modifications need to be made to my IFS statement in order to make it compatible with Google Apps Script?
For easier approach, QUERY would actually solve your issue without doing script as Broly mentioned in the comment. An approach you can try is to create a new sheet. Then have that sheet contain this formula on A1
Formula (A1):
=query('Form Responses 1'!A:C)
This will copy A:C range from the form responses, and then, copy/paste your formula for column Date Needed on column D.
Output:
Note:
Since you only copied A:C, it won't affect column D formula.
Your A:C in new sheet will update automatically, then the formula you inserted on D will recalculate once they are populated.
Add IFNA on your formula for column D to not show #N/A if A:C is still blank.
Formula (D2):
=IFNA(IFS(AND(B2 = "Toyota",C2 = "Red"),A2 + 7,AND(B2="Toyota",C2="Blue"), A2 + 21,AND(B2="Toyota",C2="Green"), A2 + 35,AND(B2 = "Honda",C2 = "Red"),A2 + 14,AND(B2="Honda",C2="Blue"), A2 + 28,AND(B2="Honda",C2="Green"), A2 + 42,AND(B2 = "Tesla"),A2 + 7), "")
I have 2 sheets the first one is Orders and second one is the ShippingDoc.
At Shipping doc, I have Cell C2. In that cell I choose/write ID from range of A7:A from Orders.
Is there a way if I choose example ID 1 at C2 then automatically A7 at Orders to change background to green. Also if I change the ID to 2 the A8 to be green and to not delete the A7 color.
There is a better way of achieving this using Apps Script. Go to tools->Script editor and there use the following code (explained on the comments in the code):
// Update everytime the value on C2 changes
function onEdit() {
var spreadsheet = SpreadsheetApp.getActive();
// Get C2 value
var C2value = spreadsheet.getSheetByName("ShippingDoc").getRange('C2').getValue();
// If input value is higher than 0
if(C2value>0){
// Ofset to set the background after A7
var number = C2value+6;
// Set background color of appropiate cell
spreadsheet.getSheetByName("Orders").getRange('A'+number+'').setBackground('green');
}
}
Check out more information about how to do amazing things in sheets with simple scripts HERE
I hope this has helped you. Let me know if you need anything or if you did not understand something.
try:
=(REGEXMATCH(""&INDIRECT("ShippingDoc!C2"), ""&A1))*(A1<>"")
I am new to the plotly visualization.
My sample data set looks like below ( Pandas data frame)
df => dataframe
role priority year Avg_in_Hrs Total_in_Hrs Avg_in_Mnths Total_in_Mnths
A high 2003 34.44 33 344 24323
A medium 2005 43.4 32 4434 24324
C critical 2003 34.55 78 233 5656
C low 2004 98.55 89 65655 5454
E mediun 2003 34.55 45 24243 1312
role column has more than 50 unique values.
I am using plotly's cufflinks which bind my pandas directly to plotly. I am using ipython notebook to plot the above data. Below is my code
cf.go_offline() ## Use plotly in offline mode
indexed_df = df.set_index(['role '])
indexed_df.iplot(kind='bar', title='plot',
filename='cufflinks/categorical-bar-chart')
Above code is generating the plot in which on mouse hover I can see the values. However,its not that much interactive so i have tried to add drop-down menu but all values of role column are not coming in my drop-down box.
I am ploting it in an offline mode.
Below is the code I am using for drop down menu.
cf.set_config_file(theme='pearl') ## set theme
buttons_1 = list()
offset = -0.5
for n, r in enumerate(list(indexed_df.index.unique())):
n = n + 1
buttons_1.append(dict(
args=['xaxis.range', [offset, offset + 1]],
label=r,
method='relayout'
))
offset += 1
print "number of unique roles are = ",n
buttons_1.append(dict(
args=['xaxis.range', [-0.5, offset]],
label='Reset',
method='relayout'
))
layout = dict(updatemenus=list([
dict(
x=-0.05,
y=0.8,
buttons=buttons_1,
yanchor='bottom'
)
])
)
indexed_df.iplot(kind='bar',title='plotl',
filename='cufflinks/categorical-bar-chart',layout=layout,fill=True,
xTitle='role')
How to overcome with the above issue ? Also I want to add search box to search my role value and display plot only for that value.
I want to add filters to all my columns and share the plot with others in the form of dashboard.
Thanks
I would appreciate some help writing a statement in a spreadsheet (Libreoffice).
IF E4 contains "bought" then do the sum of I4-F4 ELSE / ELSEIF E4 contains "sold" do the sum of F4-I4.
I have it partially working: if E4 contains "bought" the correct sum is displayed, but if E4 contains "sold" then #VALUE! is displayed.
something like:
if(exact(e4;"bought");i4-f4;if(exact(e4;"sold");f4-i4))
works for you???
Does this formula work as you want:
=IF(IFERROR(SEARCH("bought",E4),0)>0,I4-F4,IF(IFERROR(SEARCH("sold",E4),0)>0,F4-I4,""))