computer/programming/excel wizards! help an idiot!

Message Bookmarked
Bookmark Removed
Not all messages are displayed: show all messages (155 of them)

Does anyone understand the fourth/sorted?/last argument for vlookup? I don't think I've ever encountered a situation where setting it to true led to correct results.

write sed fread (Leee), Thursday, 8 September 2016 19:43 (seven years ago) link

tbh I mainly just forget to set it to False by accident and then get stupid results but this is my understanding:

if you set it to True (which is sadly the default) it only works correctly on a sorted list, and if the value doesn't appear in the list it returns the info for the "closest" match (the highest value < or == the value you typed in iirc, so if you search for 99 and it has rows with 70 and 100 but not 99 it'll give you the data for 70 instead of 100)

this dates back to when computers were just not powerful enough to search through an unsorted list in a sensible amount of time, so I guess it used to be the only option and now it's the default for reasons of backward compatibility

it runs faster in this mode but for a non-sorted list the results are completely wacky, and even with a sorted list most of the time I'd rather know that the value I'm looking for isn't there, because I mainly use it as a crude database: what is the data for the exact record with this ID?

but I guess this use would have worked for something like a ready reckoner, where you want to look up (say) which city you could get to with 15 gallons of gas, and it looks at the sorted distance/city table and says "well, San Diego is 14 gallons away, how about that for a day trip"

(uhh I'm bad at examples, sorry. there must be a much more convincing real world example. I have actually had a couple of occasions where it was a workable option but I can't remember what they were)

a passing spacecadet, Thursday, 8 September 2016 20:50 (seven years ago) link

use index match not vlookup

flopson, Thursday, 8 September 2016 21:08 (seven years ago) link

(imperative)

flopson, Thursday, 8 September 2016 21:09 (seven years ago) link

but yea spacecadet has got it iirc. in index match the last argument is 0 for exact, 1 for nearest lowest, -1 nearest at most as large, +1 nearest at least as large

flopson, Thursday, 8 September 2016 21:12 (seven years ago) link

yeah index match is certainly more efficient once you start to go beyond a couple hundred rows

laraaji p. henson (Stevie D(eux)), Friday, 9 September 2016 01:41 (seven years ago) link

A good reason for INDEX MATCH over VLOOKUP or HLOOKUP is you can search right->left or bottom->top

nate woolls, Friday, 9 September 2016 07:39 (seven years ago) link

also you can look up arrays (although this gets slow fast)

flopson, Friday, 9 September 2016 13:58 (seven years ago) link

ugh fuck arrays unless you absolutely positively need them

laraaji p. henson (Stevie D(eux)), Friday, 9 September 2016 16:04 (seven years ago) link

Learnt double vlookup, never looked back.

http://dailydoseofexcel.com/archives/2015/04/23/how-much-faster-is-the-double-vlookup-trick/

barbarian radge (NotEnough), Friday, 9 September 2016 16:20 (seven years ago) link

would love to encourage all Excel users advanced enough to be doing lookups to dabble in some scripting, I've been suggesting https://automatetheboringstuff.com to people

slathered in cream and covered with stickers (silby), Friday, 9 September 2016 16:21 (seven years ago) link

i've googled my problem but it hasn't helped, hope maybe someone here can help -
for the last few days when i try to open spotify, in both chrome and IE, i get a error message. not on my 'puter r/n so i'm being unintentionally vague. but it's some kind of message mentioning problem with ssl (whatever that means). i cleared ssl, and deleted cache, as i saw that recommended but that didn't change matters. . . ?

Bandol soleil for the St. Tropez tan (outdoor_miner), Friday, 9 September 2016 16:30 (seven years ago) link

xp- i've automated most of the tedium out of my job with R :-)

flopson, Friday, 9 September 2016 17:02 (seven years ago) link

two years pass...

I hesitate to even ask. Apparently, I have an impossible task, and the messageboards peppered with spreadsheet quarterbacks aren't helping.

I have, like, 5000 Web page titles in one column and the number of pageviews for each in another. I am looking for the average number of pageviews culminated from the list.

But I can't just SUM it up and divide it by 5000 because some of the page titles are duplicates or at least paternal twins of others. For example "The Circus is Coming to Town", "UPDATE: The Circus is Coming to Town", and "The Cicus is Coming to Town" all have different number of pageviews, but they all really only belong to one story (that had its title changed a few times.)

What I've been doing is slowly going down the list sorted alphabetically (I've F+R'ed the UPDATES: with nothing, but the stories are still there.) When I come to a bunch, I highlight the two or four cells with the pageviews in Column B, click on SUM, and keep moving.

After I've gone through 500 or so, I scroll all the way down to the end of the rows to where the sums have been appearing. Now I've got 500 cells in Column B with formulas in them that read things like "=SUM(B235:B237)". So that I know which article each cell corresponds to, I input =A237 or whatever the last three numbers were from Column B. That way, the title of the last story will appear there.

My plan after this will be to take this section of =Axxx | =SUM(Byyy:Bxxx, paste it into a new document and get rid of the formulas. Then adding that back to the original lineup. I will have an extra article now with each bunch, but then I can delete the others (whichever ones don't have the highest number), and THEN get my average.

There MUST be a different way to do this though. And as it is now, it is a PAIN IN THE ASS to just create the A column since I have to manually type out the information on each one.

If this thread doesn't get updated again for another two-and-a-half years, I'll understand.

pplains, Friday, 18 January 2019 02:02 (five years ago) link

I’ll just do that for you for $100

I have measured out my life in coffee shop loyalty cards (silby), Friday, 18 January 2019 02:06 (five years ago) link

Ha.

If there's no way out of this, I'd also be happy to hear some appropriate playlist recommendations.

pplains, Friday, 18 January 2019 02:12 (five years ago) link

i'm trash at excel but my first thought would be to add a new column and use a formula to search keywords from column A, trying to tag rows that you can sum up later. i'm curious about how many rows out of the 5000 are realistically dupes.

call all destroyer, Friday, 18 January 2019 02:19 (five years ago) link

A lot.

Much of it has to do with the header that appears at the top of the browser, which is different depending upon whether someone hits the site from an enewsletter, from Google, or from an internal page.

There aren't that many headlines that get changed, but enough to keep me off-balance.

pplains, Friday, 18 January 2019 02:54 (five years ago) link

yeah, i would be trying to pull keywords from the headlines and dumping them into a 3rd column

call all destroyer, Friday, 18 January 2019 03:03 (five years ago) link

I dunno if this is of help, but it might ease the process a little bit
Assuming a file ala


col A | col b
-------------
LOL | 50
LOL! | 100
ROFL | 50

If "LOL" and "LOL!" are the same page, then average pageviews should be 100.
What you could do is delete the value in col A for one of the duplicates, and find unique pages with COUNTA ( cf https://support.office.com/en-us/article/counta-function-7dc98875-d5c1-46f1-9a82-53f3219e2509 )

-------------


LOL | 50
| 100
ROFL | 50

Then you can write something like

total page views = sum(B1:B3)
unique pages = COUNTA(A1:A3)
Average = total / unique

Of course, this still means you have to go through the whole document and hit delete on any field that contains what you believe to be a duplicated page.
But at least you wouldn't have to write individual SUMs for various subsets etc.

Øystein, Friday, 18 January 2019 12:06 (five years ago) link

Holy cats, Øystein, I think that's going to do the trick.

I had spent three days doing it the other way and had gotten midway through the C's. In about two hours, I'm between the M's and the N's. using your method.

From A2 to A2804, I had 1,804 actual (unique) stories.

Thank you so much for the help.

pplains, Friday, 18 January 2019 23:12 (five years ago) link

Cool, I'm happy to hear it

Øystein, Saturday, 19 January 2019 09:40 (five years ago) link

seven months pass...

ANNOUNCE XLOOKUP

https://techcommunity.microsoft.com/t5/Excel-Blog/Announcing-XLOOKUP/ba-p/811376

sktsh, Wednesday, 4 September 2019 16:19 (four years ago) link

omg

Seany's too Dyche to mention (jim in vancouver), Wednesday, 4 September 2019 19:07 (four years ago) link

index/match shurely

theRZA the JZA and the NDB (darraghmac), Wednesday, 4 September 2019 19:51 (four years ago) link

i guess i am still definitely a nerd because i actually am excited by this news

Nhex, Thursday, 5 September 2019 05:25 (four years ago) link

fixes the problems vlookup and hlookup have always had, ace. does it perform better with big spreadsheets than index/match?

thomasintrouble, Thursday, 5 September 2019 10:12 (four years ago) link

thank god it defaults to exact match, 99% of the time the answer to the question "why has my vlookup done something nuts" (and god knows how many more times it happens unnoticed) is "because you have unsorted data and didn't set the optional 'exact match' parameter"

kind of feel Excel should warn you like it does when you sort on a selection and you might have wanted to sort the whole damn thing, tbh. I have deliberately used the default match before but only like once or twice - suppose that may be different for people who use it for statistical wranglings though.

anyway this is cool but I might not be able to use it much since it's nice to leave the formulae in and some of my colleagues will probably still be on Excel 2013 for the next decade

a passing spacecadet, Thursday, 5 September 2019 11:04 (four years ago) link

otm re exact match, was always an insane default behaviour

there's xmatch too

sktsh, Thursday, 5 September 2019 11:59 (four years ago) link

I guess the default made sense 30 years ago when computers were slower and we've had to live with it ever since for "backward compatibility".

Like how Excel doesn't know how many days were in the year 1900, for compatibility with Lotus 1-2-3...

a passing spacecadet, Thursday, 5 September 2019 12:26 (four years ago) link

whoa i'm stoked

when does it go live to everyone?

unashamed and trash (Unctious), Thursday, 5 September 2019 15:06 (four years ago) link

thank god it defaults to exact match, 99% of the time the answer to the question "why has my vlookup done something nuts" (and god knows how many more times it happens unnoticed) is "because you have unsorted data and didn't set the optional 'exact match' parameter"

OTM

I am also Harl (Karl Malone), Thursday, 5 September 2019 15:11 (four years ago) link

truly in awe of all you Excel wizards, you're the real heroes

president of deluded fruitcakes anonymous (silby), Thursday, 5 September 2019 16:04 (four years ago) link

xp: otm, either that or lurking HIDDEN ROWS/COLUMNS

kinder, Thursday, 5 September 2019 22:46 (four years ago) link

I am probably pulling down my pants and exhibiting my huge ignorance to the world, but how do I condition a cell's contents in Excel 2010 to achieve an IF...THEN... ELSE kind of formula? Say I want E10 to look at the contents of A10 and see if it is greater than 100, and apply one formula if it is, or another if it is not.

A is for (Aimless), Thursday, 5 September 2019 23:00 (four years ago) link

nested if loops are your man there aimless, a quick google would prob explain it better than i could tbh

theRZA the JZA and the NDB (darraghmac), Thursday, 5 September 2019 23:08 (four years ago) link

for that specific, a simple if(a10>100, formula1, formulab) or very similar would presumably get you started

theRZA the JZA and the NDB (darraghmac), Thursday, 5 September 2019 23:10 (four years ago) link

thx

A is for (Aimless), Thursday, 5 September 2019 23:26 (four years ago) link

My biggest gripe with Excel is that I have to use the F2 key to get to the formula bar. Like, who the hell finds it comfortable to use the Function keys?!

Mr. Snrub, Friday, 6 September 2019 19:05 (four years ago) link

That’s actually quicker than what I do. I always use the mouse to click in the formula bar. I’ll have to remember F2.

o. nate, Friday, 6 September 2019 19:12 (four years ago) link

two weeks pass...

OK, I have a problem that's been driving me nuts for a while. I have two columns of data, and the rows are groups. It's like this:

Col A. Col B.
person 1 | keyword 1
person 1 | keyword 2
person 1 | keyword 3
person 2 | keyword 1
person 3 | keyword 1
person 3 | keyword 3

I want to eliminate the duplicate rows and put each value in column 2 in it's own column, like this:

Person 1 | keyword 1 | keyword 2 | keyword 3
Person 2 | keyword 1 | |
Person 3 | keyword 1 | keyword 3 |

There's too much data for me to just copy/paste groups of rows and transpose them.

I've tried a pivot table, but that doesn't get me the result I need. It puts all the values of column B into a single row of labels at the top. I've tried various arcane formulae, but nothing seems to work.

fffffffffuuuuuuuuuccccccccccccckkkkkkkkkkkkk

icy bike chain rain (zchyrs), Wednesday, 25 September 2019 21:05 (four years ago) link

Some clever solutions here: superuser.com/questions/453041

o. nate, Wednesday, 25 September 2019 21:22 (four years ago) link

the excel answers I’m getting from google are bad but what you’re looking for is denormalizing into lists

mh, Thursday, 26 September 2019 01:26 (four years ago) link

or? if you search for 'vlookup that returns multiple values' there are some different methods that returns exact match results in its own cell.

Yerac, Thursday, 26 September 2019 01:45 (four years ago) link

'vlookup that returns multiple values' was definitely the right thing to search! Many thanks, Yerac. Tinkering with the formula here did the trick.

icy bike chain rain (zchyrs), Thursday, 26 September 2019 14:00 (four years ago) link

Good!

Yerac, Thursday, 26 September 2019 14:39 (four years ago) link

oh was going to suggest INDEX but couldn't remember the exact way I used it

kinder, Thursday, 26 September 2019 15:57 (four years ago) link


You must be logged in to post. Please either login here, or if you are not registered, you may register here.