Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8557347
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:33:15+00:00 2026-06-11T15:33:15+00:00

I have data in multiple columns from rows 3-15. I want to find all

  • 0

I have data in multiple columns from rows 3-15. I want to find all the unique values in that data set and have it outputted in one column.

The unique function only does one column at a time so it does not work for my purposes.

I am writing a script that will open a new sheet and copy and paste the values into the same column (combines data from multiple columns into one longer column). I will then run the unique function on the single column containing all the data to get an output of all the unique values in my original dataset (Items!B3:Z15)

I have the code written but cannot figure out how to increment a character. If there is a better way to achieve this I am open to suggestions, but I am also curious if it is possible to increment letters.

Thanks for the help, here is my current code:

function uniqueIngredients() {

  var book = SpreadsheetApp.getActiveSpreadsheet();
  var r=1;  // starting with row 1 new sheet
  var d='B';
  for (i=1; i<4; i++){  //testing by running 3 iterations
    var m = 'Ingredients!A'+r;  //Intially return Ingredients!A1 then incremented by 11 ex A12
    var c = 'Items!'+d+'4:'+d+'15';  // Initially return Items!B3:B15 then incremented by letter ex Items!C3:C15
    r = r+12;  // add 12 spaces before next copy (max number of ingredients for each item)
    d++;
    book.getRange(c).copyTo(book.getRange(m), {contentsOnly:true});
  }
};
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T15:33:16+00:00Added an answer on June 11, 2026 at 3:33 pm

    You can use an alternative parameter specification for the getRange() method, which uses column numbers rather than A1 string notation. This would be easier to increment.

    That being said, as you are copying values only, it would probably be better (more efficient) to get the source range in a block, and use Javascript to convert into a one-column array, and then set the values:

    function uniqueIngredients() {
      var ss = SpreadsheetApp.getActive();
      var sourceValues = ss.getSheetByName('Items').getRange('A3:D15').getValues();
      var target = ss.getSheetByName('Ingredients');
      var result = [];
      for (var i = 0; i < sourceValues[0].length; i++) {
        for (var j = 0; j < sourceValues.length; j++) {
          result.push([sourceValues[j][i]]);
        }
      }
      target.getRange(1, 1, result.length, 1).setValues(result); 
    }
    

    And that being said, you could use a bit of a workaround to provide the end result using spreadsheet functions only:

    =ArrayFormula(UNIQUE(TRANSPOSE(SPLIT(CONCATENATE('Items'!A3:D15&CHAR(9));CHAR(9)))))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a situation where I want to associate multiple values from one table
I have a query that transfers data from multiple slave tables into a single
I have written an SSIS package that essentially takes data from multiple sources and
i have a stored procedure that has to retrieve data from multiple tables something
I have a search form field that I want to compare with multiple columns
I have a DataGridView that is populated with 4 columns and multiple rows of
I have a data result being returned from my database with multiple rows. The
I have a data frame with multiple columns, one of which (called: drift.N) is
I have multiple data items, each with a value V that has multiple tags
I have multiple data entries that contain the following information: id_number name1 date name2

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.