Technology Get the latest on technology, electronics and software…

Any Microsoft Excel Experts?

Thread Tools
 
Old May 27, 2015 | 01:24 PM
  #41  
stogie1020's Avatar
Needs more Lemon Pledge
 
Joined: Mar 2005
Posts: 52,768
Likes: 2,000
From: Phoenix, AZ
NVM, got it using =INDIRECT
Reply
Old May 27, 2015 | 01:41 PM
  #42  
swoosh's Avatar
takin care of Business in
iTrader: (5)
 
Joined: Jan 2008
Posts: 30,994
Likes: 4,733
From: Kansas City, MO
here is how I imagine:

sheet1 column A has numbers, sheet1 column B has text/desc.
sheet2 column A has numbers, and you want the text from sheet 1 column B in sheet2 column B

=VLOOKUP(A1,Sheet1!A:B,2,FALSE)


EDIT: sorry, misread your question and replied..


glad you were able to figure it out...Indirect is similar to '=' but if you insert/delete rows, EXCEL adjusts '=' but indirect does not get adjusted!

so if you have in sheet1 col A row 1, say the number 3500...in sheet 2, col A row1 put "=indirect(sheet1!a1)" and in col B row1 put "=sheet1!a1"...now go to sheet1 and insert a row above the 3500, excel will adjust the formula in sheet2 col B, but indirect which was fetching the value 3500 will now fetch 0. Try it out!

Last edited by swoosh; May 27, 2015 at 01:48 PM.
Reply
Old May 27, 2015 | 02:01 PM
  #43  
stogie1020's Avatar
Needs more Lemon Pledge
 
Joined: Mar 2005
Posts: 52,768
Likes: 2,000
From: Phoenix, AZ
Originally Posted by swoosh
here is how I imagine:

sheet1 column A has numbers, sheet1 column B has text/desc.
sheet2 column A has numbers, and you want the text from sheet 1 column B in sheet2 column B

=VLOOKUP(A1,Sheet1!A:B,2,FALSE)


EDIT: sorry, misread your question and replied..


glad you were able to figure it out...Indirect is similar to '=' but if you insert/delete rows, EXCEL adjusts '=' but indirect does not get adjusted!

so if you have in sheet1 col A row 1, say the number 3500...in sheet 2, col A row1 put "=indirect(sheet1!a1)" and in col B row1 put "=sheet1!a1"...now go to sheet1 and insert a row above the 3500, excel will adjust the formula in sheet2 col B, but indirect which was fetching the value 3500 will now fetch 0. Try it out!

Good to know about the adjustment with vlookup versus INDIRECT, thanks! Once I had the formula results, I copied and pasted as values since the initial listing of 3500 items will never change.

I tried it with vLookup and eventual got that to work, too. I know so little about the deeper ways to use excel... I had trouble with the vlookup initially because I didn't have column A set to sequential numbers, I just had the actual values (in this case email addresses) so the vlookup was not working. Once I added a column A with 1, 2, 3, etc. it worked like a charm,

Thanks!
Reply
Old May 27, 2015 | 02:04 PM
  #44  
svtmike's Avatar
Team Owner
20 Year Member
Liked
Loved
Community Favorite
 
Joined: Oct 2003
Posts: 37,702
Likes: 3,898
From: Chicago
Stoges you could also use =INDEX(). Cool thing about that is your array could be two dimensional.
Reply
Old May 27, 2015 | 02:06 PM
  #45  
stogie1020's Avatar
Needs more Lemon Pledge
 
Joined: Mar 2005
Posts: 52,768
Likes: 2,000
From: Phoenix, AZ
I will have to check that out, thanks!

EDIT: Mike, Index would have been perfect before I added the sequential numbers column to the list for the vlookup.

Dammit, there are three ways to do what I wanted!

Last edited by stogie1020; May 27, 2015 at 02:13 PM.
Reply
Old May 27, 2015 | 02:09 PM
  #46  
swoosh's Avatar
takin care of Business in
iTrader: (5)
 
Joined: Jan 2008
Posts: 30,994
Likes: 4,733
From: Kansas City, MO
^^^ +1

you can use INDEX along with MATCH...

MATCH returns the column/row number of the string it matches. You can feed that into INPUT to get the contents of the cell.

I think vlookup is your best option unless you want to manipulate cells
Reply
Old Oct 29, 2015 | 06:48 PM
  #47  
stogie1020's Avatar
Needs more Lemon Pledge
 
Joined: Mar 2005
Posts: 52,768
Likes: 2,000
From: Phoenix, AZ
OK, slightly more complex question now...

In column 1 I have a list of names of people who came into an office. Each name can appear multiple times as they may have come in more than once.

In column 2 I have a second name, of the person the 'column one' name saw when they came into the office . Column one names can be listed with a column two name more than once due to multiple visits.

What I need to do is isolate the column one names that ONLY saw one particular column two name (no matter how many times).

In the following example, I am looking for Mike and Peter (both ONLY ever saw Jeff) but not Mary or Jane:


Reply
Old Oct 30, 2015 | 08:49 PM
  #48  
RenoTL's Avatar
Racer
10 Year Member
Liked
Loved
Community Favorite
 
Joined: Mar 2013
Posts: 393
Likes: 68
From: Reno, NV
Originally Posted by stogie1020
OK, slightly more complex question now...

In column 1 I have a list of names of people who came into an office. Each name can appear multiple times as they may have come in more than once.

In column 2 I have a second name, of the person the 'column one' name saw when they came into the office . Column one names can be listed with a column two name more than once due to multiple visits.

What I need to do is isolate the column one names that ONLY saw one particular column two name (no matter how many times).

In the following example, I am looking for Mike and Peter (both ONLY ever saw Jeff) but not Mary or Jane:


Unless you have a lot of data, wrouldn't a simple Pivot Table work for you? In the table, you'll have go look at which names from col A only have only listing showing from col B but those are the ones you're wanting to find.
Reply
Old Dec 17, 2019 | 01:14 PM
  #49  
stogie1020's Avatar
Needs more Lemon Pledge
 
Joined: Mar 2005
Posts: 52,768
Likes: 2,000
From: Phoenix, AZ
I come to the well of excel knowledge once again.

I have 7500+ rows I need to sort through. Column A has a date. Column B has a plain text (for sake of simplicity, I am showing it as the name of a color).

There are multiple instances of many dates, some with the same color and some with different colors.

Example:



What I would like to do is compile a listing that shows a single instance of each color present for each specific date.

I.e., I want to end up with:
1/4/18 blue
1/5/18 blue
1/7/18 red
1/9/18 red blue green
...
1/15/18 green red
1/16/18 blue
1/17/18 green

Any ideas how to do this?
Reply
Old Dec 17, 2019 | 01:54 PM
  #50  
stogie1020's Avatar
Needs more Lemon Pledge
 
Joined: Mar 2005
Posts: 52,768
Likes: 2,000
From: Phoenix, AZ
Forget my last post. I oversimplified it too much. Working on a better example of the actual data.
Reply
Old Dec 17, 2019 | 02:03 PM
  #51  
stogie1020's Avatar
Needs more Lemon Pledge
 
Joined: Mar 2005
Posts: 52,768
Likes: 2,000
From: Phoenix, AZ
OK, here is what I really need:



I need to go from multiple daily entries with varying colors to a single entry per day with ALL colors that were previously reported for any entry that day.
Reply
Old Dec 17, 2019 | 03:33 PM
  #52  
thoiboi's Avatar
Senior Moderator
15 Year Member
Community Builder
Loved
Community Favorite
 
Joined: Apr 2010
Posts: 48,302
Likes: 9,173
From: SoCal, CA
VLOOKUP and CONCAT/TEXTJOIN will be your friend in this case:

https://www.get-digital-help.com/exc...into-one-cell/

somewhat similar use case
Reply
Old Dec 17, 2019 | 04:20 PM
  #53  
stogie1020's Avatar
Needs more Lemon Pledge
 
Joined: Mar 2005
Posts: 52,768
Likes: 2,000
From: Phoenix, AZ
Originally Posted by thoiboi
VLOOKUP and CONCAT/TEXTJOIN will be your friend in this case:

https://www.get-digital-help.com/exc...into-one-cell/

somewhat similar use case
Looks awesome, thanks!
Reply
Old Dec 17, 2019 | 08:37 PM
  #54  
svtmike's Avatar
Team Owner
20 Year Member
Liked
Loved
Community Favorite
 
Joined: Oct 2003
Posts: 37,702
Likes: 3,898
From: Chicago
I'd use PowerQuery to unpivot the colors and then regroup the dates with a list of colors.

But I'm weird.
Reply
Old Dec 17, 2019 | 08:57 PM
  #55  
svtmike's Avatar
Team Owner
20 Year Member
Liked
Loved
Community Favorite
 
Joined: Oct 2003
Posts: 37,702
Likes: 3,898
From: Chicago
Here's the PowerQuery script:

let
Source = Excel.CurrentWorkbook(){[Name="TableIn"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Date", type date}, {"ColorList", type text}}),
#"Replaced Value" = Table.ReplaceValue(#"Changed Type"," ","",Replacer.ReplaceText,{"ColorList"}),
#"Split Column by Delimiter" = Table.ExpandListColumn(Table.TransformColumns(#"Re placed Value", {{"ColorList", Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "ColorList"),
#"Changed Type1" = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"ColorList", type text}}),
#"Grouped Rows" = Table.Group(#"Changed Type1", {"Date"}, {{"Colors", each List.Distinct([ColorList]), type text}}),
#"Added Custom" = Table.AddColumn(#"Grouped Rows", "Unique Colors", each Text.Combine( [Colors], ", " ), type text),
#"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Colors"})
in
#"Removed Columns"
What this does--
- read in the data (headers are "Date" and "ColorList")
- set types on the data
- get rid of spaces so we just have comma delimiters
- split columns with more than one color into one row for each color
- group a list of distinct colors by each date
- split that list out, separated by commas and a space for readability
- get rid of the list column

and done.

Put your original data into a table called "TableIn" with column headers as mentioned above. Copy this script into the Advanced Editor under the PowerQuery Editor. Save it and have it load to a new table.

No messing around with constant recalculations or anything. Mikey doesn't believe in cleaning data with the spreadsheet. That's a pre-processing step.

If you are dealing with huge data, this will be much much faster than any array formula based solution as well.

Last edited by svtmike; Dec 17, 2019 at 09:11 PM.
Reply
Old Dec 18, 2019 | 10:23 AM
  #56  
stogie1020's Avatar
Needs more Lemon Pledge
 
Joined: Mar 2005
Posts: 52,768
Likes: 2,000
From: Phoenix, AZ
Wow, that looks awesome Mike. I will play with this today and see if I can get it to work.

Thanks!
Reply
Old Dec 18, 2019 | 02:39 PM
  #57  
oo7spy's Avatar
Senior Moderator
 
Joined: Dec 2010
Posts: 31,897
Likes: 7,251
From: Austin, TX
No VBA solution?
Reply
Old Dec 18, 2019 | 07:31 PM
  #58  
svtmike's Avatar
Team Owner
20 Year Member
Liked
Loved
Community Favorite
 
Joined: Oct 2003
Posts: 37,702
Likes: 3,898
From: Chicago
Originally Posted by oo7spy
No VBA solution?
Bleah. So slow.
Reply
Old Dec 18, 2019 | 07:58 PM
  #59  
svtmike's Avatar
Team Owner
20 Year Member
Liked
Loved
Community Favorite
 
Joined: Oct 2003
Posts: 37,702
Likes: 3,898
From: Chicago
If y'all haven't tried PowerQuery out, you should. Coding is assisted by a GUI, and debugging is a snap because you see the result as soon as you enter the new line in the script.
Reply
Old Dec 20, 2019 | 10:42 PM
  #60  
Bearcat94's Avatar
AZ Community Team
 
Joined: May 2007
Posts: 32,488
Likes: 7,771
From: N35°03'16.75", W 080°51'0.9"
I've got two rows of data. I need to multiply the row data, then sum the products across columns. I can do it 'brute force' but I'm sure there must be an easier way. What I'm doing:

(a1*a2)+(b1*b2)+(c1*c2)+(d1*d2)+ ..... +(x1*x2)
Reply
Old Dec 21, 2019 | 10:32 AM
  #61  
svtmike's Avatar
Team Owner
20 Year Member
Liked
Loved
Community Favorite
 
Joined: Oct 2003
Posts: 37,702
Likes: 3,898
From: Chicago
=sumproduct( a1:x1, a2:x2 )
Reply
Old Jan 6, 2020 | 12:02 PM
  #62  
stogie1020's Avatar
Needs more Lemon Pledge
 
Joined: Mar 2005
Posts: 52,768
Likes: 2,000
From: Phoenix, AZ
Originally Posted by svtmike
Here's the PowerQuery script:



What this does--
- read in the data (headers are "Date" and "ColorList")
- set types on the data
- get rid of spaces so we just have comma delimiters
- split columns with more than one color into one row for each color
- group a list of distinct colors by each date
- split that list out, separated by commas and a space for readability
- get rid of the list column

and done.

Put your original data into a table called "TableIn" with column headers as mentioned above. Copy this script into the Advanced Editor under the PowerQuery Editor. Save it and have it load to a new table.

No messing around with constant recalculations or anything. Mikey doesn't believe in cleaning data with the spreadsheet. That's a pre-processing step.

If you are dealing with huge data, this will be much much faster than any array formula based solution as well.
OK, so I tried to make this work. Tried.

Ultimately, I needed to get a report out, so I re-generated the output of the data into a slightly different format that I was able to compile what I needed from.

However, I quickly saw the power of PowerQuery, and started going down the rabbit hole of trying to learn how to use it. There are a bunch of "intro's" and such, but I feel a little lost, as most I found assume serious VB skills.

Any good places to start that you recommend to learn how to use PQ?
Reply
Old Jan 9, 2020 | 10:04 PM
  #63  
svtmike's Avatar
Team Owner
20 Year Member
Liked
Loved
Community Favorite
 
Joined: Oct 2003
Posts: 37,702
Likes: 3,898
From: Chicago
Originally Posted by stogie1020
OK, so I tried to make this work. Tried.

Ultimately, I needed to get a report out, so I re-generated the output of the data into a slightly different format that I was able to compile what I needed from.

However, I quickly saw the power of PowerQuery, and started going down the rabbit hole of trying to learn how to use it. There are a bunch of "intro's" and such, but I feel a little lost, as most I found assume serious VB skills.

Any good places to start that you recommend to learn how to use PQ?
I am a learn-by-google self-teaching type. I rarely follow a curriculum of any kind when learning a new Excel feature... I usually figure things out as I solve a problem. Expert blogs and developer forums are where I find most of my info

I do have experience with quite a few programming languages though, so when I see a new one I can usually get the gist of it pretty quickly.

I used to like vb, but it is really old tech and clunky compared to the newer tools.
Reply
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
empty12
Money & Investing
4
Mar 2, 2010 11:00 PM
aunggu2002
2G CL (2001-2003)
72
Jan 6, 2008 05:29 PM
RyeCL
Technology
11
Jan 12, 2007 10:20 AM
MikeSwing
Technology
3
May 12, 2005 09:43 AM
rolly7007
2G CL (2001-2003)
14
Nov 1, 2004 05:49 AM




All times are GMT -5. The time now is 02:14 PM.