Results 1 to 12 of 12

PQ FindText exact matching columnname

Threaded View

  1. #1
    Forum Contributor
    Join Date
    04-30-2010
    Location
    Denmark
    MS-Off Ver
    Office 365
    Posts
    215

    PQ FindText exact matching columnname

    Hi all

    I get data from several environments, and they might not all have the same columns. In order to be able to "align" those, so I can use the same Power Query on them, I add some columns, if they do not already exist.

    I do this with the following code:
    if List.Count(List.FindText(Table.ColumnNames(Source), "Colors" ))= 1 then Source else Table.AddColumn(Source, "Colors", each "", type text)
    This works well, and it will create a column called "Colors", if it does not exist and if it already exists, it does nothing.

    The problem is that FindText does not search for exact text. So if I have 2 columns, respectively called "Fruits" and "BlueFruits", and does the same thing with "Fruits", it will count both columns, not just "Fruits".

    How can I use the same principle, to create new columns, if they not not exist, but only based on exact matching search?

    I attached a demo sheet that shows the problem.

    Best regards
    Imbizile
    Attached Files Attached Files
    Last edited by Imbizile; 03-30-2021 at 04:36 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. VLOOKUP & Table ColumnName
    By dageci in forum Excel General
    Replies: 2
    Last Post: 06-02-2019, 10:32 AM
  2. [SOLVED] Find exact text in exact cell but on any sheet?
    By nobodyukno in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-12-2017, 02:59 PM
  3. Replies: 4
    Last Post: 01-06-2015, 09:15 PM
  4. To Sort exact and partial exact match for a single column.
    By Jagdev in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-22-2014, 05:08 AM
  5. Formula to work out an exact average over an exact number
    By Sandyshirl in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-11-2013, 01:35 AM
  6. SQL against Excel Table returns nothing when "Where [ColumnName] = ""
    By rgi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-19-2010, 04:21 PM
  7. FindText Extraction?
    By flembss2 in forum Excel General
    Replies: 4
    Last Post: 06-03-2008, 04:17 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1