Quantcast
Channel: Hot Weekly Questions - Web Applications Stack Exchange
Viewing all 9708 articles
Browse latest View live

Combining Duplicate Data Within A Table? | Google Sheets

$
0
0

Table Data:

Table Data

This is a dulled down version of the Data Table I am trying to filter - which is a massive list of leads.

Basically, I am trying to find a way to combine all rows with similar contact information. Since addresses, phone numbers, and emails are unique identifiers (Meaning only one person or residence can have any given address, phone number, or email), those are the columns I will be using as filter rules.

The current formula I have will create an array of data - combining all data in column A - if at least one of the values from Columns B-D match.

This results in an almost perfect result:

Filtered Table

This filtered table outputs Duplicate if at least one of the values within Columns B:D are not Unique. The issue here is the formula is only looking for duplicates on a 2D scale - explaining why there are two Andrew 2's and Evan 1's.

So in short, Andrew 2 is shown twice because Rows 3 and 6 share the same values in Column CandRows 4 and 6 share the same values in Column D.

For this particular case, since Andrew 2 has the same phone number as Walter 1 - but the same email as Trey 1 and Evan 1 - the goal is use formulas to assume Walter 1 is the same contact as Trey 1 and Evan 1 based on both of their relationships with Andrew 2. The end result would be Walter 1 listed in Row 4, or of equivalence. Extremely complex, but nonetheless I need to figure this out.

I have put well over 12 hours into trying to figure out how to output each name only once and completely combine the data I need correctly, but I simply am at a stand still.

I have two formulas that output the same results shown in the second table:

Filter Formula (Pasted into G2 and copied down Column G):

=IF(AND($B2 <> "", $C2 <> "", $D2 <> ""),IF(AND(COUNTIF($B$2:$B2, $B2) = 1,COUNTIF($C$2:$C2, $C2) = 1,COUNTIF($D$2:$D2, $D2) = 1),Transpose(SORT(UNIQUE(FILTER($A:$A,($B:$B = $B2)+($C:$C = $C2)+($D:$D = $D2))), 1, TRUE)),"Duplicate"),"")

Query Formula (Pasted into G2 and copied down Column G):

=IF(AND($B2 <> "", $C2 <> "", $D2 <> ""),IF(AND(COUNTIF($B$2:$B2, $B2) = 1,COUNTIF($C$2:$C2, $C2) = 1,COUNTIF($D$2:$D2, $D2) = 1),TRANSPOSE(UNIQUE(QUERY(A:D,"Select A where (B = '"&B2&"') OR (C = '"&C2&"') OR (D = '"&D2&"') label A ''",1))),"Duplicate"),"")

Here is a copy of my sheet if you would like to experiment on there. I have random formulas all over the place because I've been experimenting with this a lot. Thank you in advance for any help. https://docs.google.com/spreadsheets/d/1b2kaI-Muuf7V7CDBvdhsorSzqKmKJdQ_TJsBoQX26GM/edit?usp=sharing


Working With Durations In Google Apps Script

$
0
0

I'm trying to write a function in Google Apps Script to manipulate durations calculated in Google Sheets. The cells holding the durations look like:

18:40:00
26:42:01

When I pass a duration into my code it appears to come in as a date object. So I've been using Date.getHours() et al to pull out the components of the time. But when the hours exceeds 23, it comes out mod 24.

Where did the "days" part of the duration go? Is there a method I can call on the Date object to get it?

How to stop the "friendship anniversary" notifications on Facebook?

$
0
0

I regularly receive notifications in Facebook Messenger about the anniversary of my friendship (amiversaire in the French version) with a friend. Messages like

you have been friends with [friend] since [date]

(my own translation from French). The message also appears in the private chat with that friend.

Is there a way to turn off these notifications?

I tried to google it but all results are about notifications of friends' anniversary, which I want to keep.

Add Number of days and time on a datetime field

$
0
0

I have the following sheet:

  | A               | B          | C
1 | 23/2/2020 12:00 | 5          | 2:00
2 | 12/4/2020 13:00 | 2          | 2:0

And I want to calculate how many days after and how many hours after the date will be. So as an example the 23/2/2020 12:00will be 28/02/2020 14:00.

Just by doing =A1+C1 I get 23/2/2020 12:00 (I add the hours) but how I will increase the datetime by days?

How to prevent Google Sheets from reformating input from Google Forms?

$
0
0

I need to create Google Form where users can submit different data. Problem is that some of them use comma and others use dots as decimal separator and my Form should handle them both. Problem is, it doesn't. Let me give you clear example:

Consider a Google Form that has two "Short answer text" inputs named T1 and T2, no input validation. Assume that the Form is linked to a Sheet. If a user enters '0.123' into the first textbox and '0,123' into the other, the input will be recorded in the Sheet as '0.123' and '123' respectively. I assume that some kind of formatting is taking place where first input is recognized as number and I don't even know what happened to the second one. So, following excellent answer by Tanaike, I installed OnSubmit triggers in the Sheet

function onSubmit(e){
  Logger.log("%s", JSON.stringify(e));
}

which gives me following log:

[19-12-12 07:46:33:682 PST] {"authMode":{},"values":["12/12/2019 16:46:33","0.123","123"],"namedValues":{"Timestamp":["12/12/2019 16:46:33"],"T1":["0.123"],"T2":["123"]},"range":{"columnStart":1,"rowStart":2,"rowEnd":2,"columnEnd":3},"source":{},"triggerUid":"2545668"}

Installing similar onSubmit handler in the Form

function onSubmit(e){
  Logger.log("authMode=%s, source.getId()=%s", e.authMode, e.source.getId());
  var items = e.response.getItemResponses();
  for (i in items){
    Logger.log("getItem().getTitle()=%s, getResponse()=%s", items[i].getItem().getTitle(), items[i].getResponse());
  }

I get:

[19-12-12 07:46:33:848 PST] authMode=FULL, source.getId()=1P7OAN5QrctyFW32F9XLm25V48NxuUkwwqjr6YI9J2Ko [19-12-12 07:46:34:520 PST] getItem().getTitle()=T1, getResponse()=0.123 [19-12-12 07:46:34:612 PST] getItem().getTitle()=T2, getResponse()=0,123

So, this tells me that form actually accepts input as-is, but somewhere in the transfer, input gets reformatted and information is lost. Some things I tried:

  1. changing localization setting will NOT solve the problem because a) Problem could simply just shift to numbers with dot as separator and b) I have exactly the same problem on other input data (dates, zip codes) and would love to have more general solution

  2. using regex does not solve the problem - the form I develop uses regex abundantly but minimal example demo shows the that the problem is independent of regex.

  3. pre-formatting sheet before submitting. Doesn't work because it seems that submit is recorded through inserting new row.

So my question is how to make Form/Sheet combo record literal input without reformatting or any other intervention? Once I have literal input in the Sheet, I know how to handle it further.

Converting multiple columns to list

$
0
0

I'm currently using Google Sheets and I'm capturing data with Google Forms.

What I'm receiving from Forms, inside the corresponding sheets is an entry with timestamp, clientID, item1, quantity1, item2, quantity2 (...itemN, quantityN). Where N at this time is 5, but I'm still solving how it happens for 1 and 2 before I add 3 through 5.

What I'm trying to do is merge the lists and quantity into a unified column(s)

Example

in:

timestampA, clientIDA, item1, quantity1, item2, quantity2... itemN, quantityN

timestampB, clientIDB, item1, quantity1, item2, quantity2... itemN, quantityN

out:

timestampA, clientIDA, item1, quantity1

timestampA, clientIDA, item2, quantity2

...

timestampA, clientIDA, itemN, quantityN

timestampB, clientIDB, item1, quantity1

timestampB, clientIDB, item2, quantity2

...

timestampB, clientIDB, itemN, quantityN

item1 and quantity1 are required, item2 through itemN and quantity2 through quantityN are not.

It's also important that I don't need to manually transpose as the data entering is continuous and I won't be monitoring it.

I tried to do it with pivots, but as item1 and item2 have different column names it won't aggregate. If I added a row on top and added new titles then execute the query below, it only calls 1 column (item1 or item2) not (item1 and item2) as they're not unique.

Does anyone have any idea how I can do this?

How to check if there is any Data Validation error in the whole spreadsheet?

$
0
0

Is there a way to check in a Google Sheets spreadsheet, if there is at least one cell violating a Data Validation rule? If such functionality is not built-into the app, how can I write a Google Apps Script to implement a "Check for Data Validation errors" menu item that checks for any error?

Why am I getting notifications about someone I have blocked on Twitter

$
0
0

I get emails from Twitter for notifications, so the other day I notice I got an email about a notification from Twitter about someone I have blocked what they tweeted! Does anyone know why I’m getting notifications about someone I have blocked?


ImportRange and Query Function Data is condensing into one cell

$
0
0

I am trying to create a spreadsheet that imports data from one spreadsheet into another and then sorts that data by a key phrase. Here is the formula I am using:

=Query(Importrange("URL","ReferenceTab!Cell:Cell"), "Select * where Col2 = 'Lost'")

The problem that I am having is that this formula works on some of the tabs in the same spreadsheet, but then in others it causes all of the data to compile into one cell. I have no idea how to fix this.

ArrayFormula / SumIf for multiple columns based on dymanic date / Monday through Friday

$
0
0

I have several form responses sheets (that I ImportRange into a common workbook) that need to display a total every Monday through Friday of the week that updates for current week Monday - Friday. I thought it may be an ArrayFormula(SumIf....based on date range but I cannot figure it out. In addition to this...I then need to query those same Monday - Friday totals into a Summary sheet within this same workbook...but I think I have that part figured out for now.

Any help to figure this out would be greatly appreciated!

Google App Script to Hide & Show Rows Based on Dropdown Selection on Active Sheet

$
0
0

I am trying to create code that will automatically hide or show rows depending on the selection of the dropdown on whatever sheet is currently active. The drop down selection is a list of all the months in the year. I want to selectively hide rows because my template sheet populates out to 31 days so there is some overrun for months that have less days that that.

I took code from several other questions and have been experimenting with trying to find a way to make it do what I want, but have been completely unsuccessful. It is important that this code specifically functions on whatever sheet is currently active because there will be multiple sheets in this document and I don't want to call them by name. Here is the code I have, and I appreciate any help that anyone can give me.

function onEdit(e) {

  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var sheet = ss.getActiveSheet();
  var lastrow = sheet.getLastRow();
  var long = ['January','March','May','July','August','October','December']
  var medium = ['April','June','September','November']
  var short = ['February']

  if(e.range.columnStart==2 && e.range.rowStart==3 && e.range.getSheet().getName()=='Sheet2') {//add your sheet name
    if(e.value==long) {
      e.range.getSheet().showRows(147,15);
    }
    if(e.value==medium) {
      e.range.getSheet().hideRows(157,5);
    }
    if(e.value==short) {
      e.range.getSheet().hideRows(147,15);
    }
  }
}

//'February'

//'April','June','September','November'

//'January','March','May','July','August','October','December'

How to sync Gmail Inbox across devices?

$
0
0

I use Gmail on my Android phone, desktop PC and laptop.
It seems to track the inbox separately for each.

So, if I have 10 emails (1-10) on my PC and I archive 1,5,9, when I got to my phone, 1-10 are still there.

This is a bit of headache to manage.

How to fill columns automatically when a new row is added

Is there a way to copy text from two cells into another spreadsheet only if another cell has a YES?

$
0
0

I want to copy the text in Cells A1 and B1 into another spreadsheet that will be emailed out, but only if the text in Cell E1 has a "YES" in it.

How would I go about doing something like this in Google Sheets?

How to download my starred inbox emails on Gmail?

$
0
0

I noticed that Gmail deletes starred messages after some time, how can I download all my starred messages?


Increment value based on condition

$
0
0

I'm trying to combine arrayformula with an increment value based on a condition.

Basically I have a column called purpose, it basically has 2 values - Restock and Order. Upon order, column Count Order will display 1, otherwise, 0. On the column over, without arrayformula I'd add the row above with the value on the left, example

Purpose | Count Order | Increment
Restock | 0           | 0
Order   | 1           | 1
Restock | 0           | 1
Order   | 1           | 2

I'd normally use the code for C2=B2, then the subsequent line would be C3=B3+C2

With arrayformula, my formula that I came up with was

={"Increment"; arrayformula(if(A2:A="","", (B2:B)+(C1:C)))}

Which gives me a circular error. I'm guessing in part I'm trying to add the header which the only thing I can think of is have this array start on.

Is there a better way than to start lower with this formula?

Gmail Filter Not Archiving Emails

$
0
0

I have the following Gmail filter:

Matches: to:(marketing.emails@mail.com)
Do this: Skip Inbox, Mark as read, Apply label "marketing.emails@mail.com", Never mark it as important

The filter marks the messages as read, but it doesn't archive the emails. They remain in my inbox.

If I open the filter, it finds the emails in my inbox. If I check "Also apply the filter to matching conversations", the matching emails in my inbox are successfully archived. But future emails don't get archived. This is the issue - I don't want to manually apply the filter everyday.


A similar question is asked here. The answers are to go to Settings→Inbox→Filtered Mail and unchecking the option: "Override filters - Include important messages in the inbox that may have been filtered out."

I have already unchecked this option and the issue remains, so please don't suggest this solution.


Note - This filter is applied to emails that are received through Gmailify. Since the "Mark as read" portion of the filter works, I don't know if this is a relevant detail.

How to add Print buttom in a sheet to print other sheet

$
0
0

I need a script to, adding a print button in a sheet1, to print the entire sheet2.

How can I do this?

Many thanks

Auto fill cells with custom script - enforce sleep between calls

$
0
0

I have a custom script which calculates the distance between two addresses. The script uses API call to Google Maps. I have my addresses listed in one column (about 4000 addresses), the other address is fixed. If I abuse the api calls and fill down all the 4000 cells, the api locks for 24 hours. Is there a way to enforce a sleep call between the subsequent cell fills? I got the script from the web, here it is:

/**
* Get Distance between 2 different addresses.
* @param start_address Address as string Ex. "300 N LaSalles St, Chicago, IL"
* @param end_address Address as string Ex. "900 N LaSalles St, Chicago, IL"
* @param return_type Return type as string Ex. "miles" or "kilometers" or "minutes" or "hours"
* @customfunction
*/   
function GOOGLEMAPS(start_address,end_address,return_type) {
    // https://www.chicagocomputerclasses.com/   // Nov 2017   // improvements needed
     var mapObj = Maps.newDirectionFinder();   mapObj.setOrigin(start_address);   mapObj.setDestination(end_address); var directions = mapObj.getDirections();
     var getTheLeg = directions["routes"][0]["legs"][0];
     var meters = getTheLeg["distance"]["value"];
     switch(return_type){
    case "miles":
      return meters * 0.000621371;
      break;
    case "minutes":
        // get duration in seconds
        var duration = getTheLeg["duration"]["value"];
        //convert to minutes and return
        return duration / 60;
      break;
    case "hours":
        // get duration in seconds
        var duration = getTheLeg["duration"]["value"];
        //convert to hours and return
        return duration / 60 / 60;
      break;      
    case "kilometers":
      return meters / 1000;
      break;
    default:
      return "Error: Wrong Unit Type";    }    }

Count Occurrences of Unknown Values

$
0
0

I'm really new to Google Sheets and formulas in general. I know you can count occurrences of values when you know what you're counting e.g. the times red is written in the column and you can search for the word specifically, but I just want to make a count of how many times things appear.
For example;

Sarah  
Sally
Mike
Dolly
Sarah
Frances
Frances
Jemima
Sarah

My list would continue and I don't know what name is going to come next or I won't be keeping track of the names being put on so I can't tell it to search for a specific name.
Is there a way to tell Google Sheets to keep a tally of the occurrences and keep track and update when a new name is added to the list?

Viewing all 9708 articles
Browse latest View live


Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>