Resend my activation email : Register : Log in 
BCF: Bike Chat Forums


Excel Gurus, lend me your lug'oles.

Reply to topic
Bike Chat Forums Index -> The Geek Zone
View previous topic : View next topic  
Author Message

The Shaggy D.A.
Super Spammer



Joined: 12 Sep 2008
Karma :

PostPosted: 14:37 - 07 Dec 2016    Post subject: Excel Gurus, lend me your lug'oles. Reply with quote

May be a simple thing, but my Google-fu is weak today, I have the dumb. I have a single spreadsheet with two sheets, the first contains header information with a summary, and the second sheet contains multiple rows with details relating to the header. As a trimmed down example, sheet one has :-

Code:
A      B            C
Item   Description      Active?
----   -----------      -------
Thing1   Name of Thing 1   True
Thing2   Name of Thing 2   True
Thing3   Name of Thing 3   True


And sheet two has...

Code:
A      B         
Item   Detail   
----   ------
Thing1   Something about Thing 1
Thing1   Something else about Thing 1
Thing2   Something about Thing 2
Thing2   Something else about Thing 2
Thing1   More stuff about Thing 1
Thing3   Something about Thing 3


Note that these are not in order (they actually have a timestamp, but not relevant for the example). When adding a new row to the detail sheet, I have a validation rule that allows a dropdown from sheet 1, column A. This means that I can select a value of Thing1, Thing2 or Thing3. This works fine and dandy.

My problem is that from time to time, the header items are eventually marked as inactive (column C = False). I'd like my validation dropdown to ignore any of those items in column A that are marked as such, so that if Thing2 becomes inactive, then my drodown will only present Thing1 and Thing3 as a valid selection.

Any pointers?
____________________
Chances are quite high you are not in my Monkeysphere, and I don't care about you. Don't take it personally.
Currently : Royal Enfield 350 Meteor
Previously : CB100N > CB250RS > XJ900F > GT550 > GPZ750R/1000RX > AJS M16 > R100RT > Bullet 500 > CB500 > LS650P > Bullet Electra X & YBR125 > Bullet 350 "Superstar" & YBR125 Custom > Royal Enfield Classic 500 Despatch Limited Edition (28 of 200) & CB Two-Fifty Nighthawk > ER5
 Back to top
View user's profile Send private message You must be logged in to rate posts

Evil Hans
World Chat Champion



Joined: 08 Nov 2015
Karma :

PostPosted: 16:58 - 07 Dec 2016    Post subject: Reply with quote

A quick way to do it would be to have an extra column on sheet one that has the name in it, but only if active is true ... something like

=IF(C2,A2,"")

Then use that column to populate your validation list.

Quick 'n' Dirty Wink
____________________
Triumph Sprint ST 1050. And it's Red.
 Back to top
View user's profile Send private message You must be logged in to rate posts

The Shaggy D.A.
Super Spammer



Joined: 12 Sep 2008
Karma :

PostPosted: 18:12 - 07 Dec 2016    Post subject: Reply with quote

Aye, I tried that, problem was that if (say) Thing2 was inactive, you'd get a dropdown list of :-

Thing1
<blank>
Thing3

Eventually, you'd be scrolling through tons of blanks before getting to a valid value.
____________________
Chances are quite high you are not in my Monkeysphere, and I don't care about you. Don't take it personally.
Currently : Royal Enfield 350 Meteor
Previously : CB100N > CB250RS > XJ900F > GT550 > GPZ750R/1000RX > AJS M16 > R100RT > Bullet 500 > CB500 > LS650P > Bullet Electra X & YBR125 > Bullet 350 "Superstar" & YBR125 Custom > Royal Enfield Classic 500 Despatch Limited Edition (28 of 200) & CB Two-Fifty Nighthawk > ER5
 Back to top
View user's profile Send private message You must be logged in to rate posts

carvell
Scuttler



Joined: 05 Sep 2003
Karma :

PostPosted: 19:09 - 07 Dec 2016    Post subject: Reply with quote

The Shaggy D.A. wrote:
Aye, I tried that, problem was that if (say) Thing2 was inactive, you'd get a dropdown list of :-

Thing1
<blank>
Thing3

Eventually, you'd be scrolling through tons of blanks before getting to a valid value.

I've just followed this:
https://www.extendoffice.com/documents/excel/2445-excel-drop-down-list-ignore-blank.html

And it works fine - you can use it to automatically generate a separate list without blanks which you then use to derive the dropdown from.

Remember Ctrl-Shift-Enter.
____________________
Yamaha TDM 850
 Back to top
View user's profile Send private message Send e-mail You must be logged in to rate posts

GSTEEL32
Traffic Copper



Joined: 24 Feb 2010
Karma :

PostPosted: 19:46 - 07 Dec 2016    Post subject: Reply with quote

The Shaggy D.A. wrote:
Aye, I tried that, problem was that if (say) Thing2 was inactive, you'd get a dropdown list of :-

Thing1
<blank>
Thing3

Eventually, you'd be scrolling through tons of blanks before getting to a valid value.

If it got to this stage with me, I'd simply RANK the values & VLOOKUP the top 50 results on a separate sheet, and bobs your erm.. what's a face. ...

Edit: forgot to mention, if your answer is a 0 or 1 answer, stick a cheeky + RAND function in, so it can still RANK a 1 answer . Email me if this sort of makes sense, but you need a better explanation. ...
 Back to top
View user's profile Send private message Send e-mail You must be logged in to rate posts

Evil Hans
World Chat Champion



Joined: 08 Nov 2015
Karma :

PostPosted: 20:06 - 07 Dec 2016    Post subject: Reply with quote

The Shaggy D.A. wrote:
Aye, I tried that, problem was that if (say) Thing2 was inactive, you'd get a dropdown list of :-

Thing1
<blank>
Thing3

Eventually, you'd be scrolling through tons of blanks before getting to a valid value.


The validation list has an option to ignore blanks. I confess I haven't tried it though.
____________________
Triumph Sprint ST 1050. And it's Red.
 Back to top
View user's profile Send private message You must be logged in to rate posts

el_oso
World Chat Champion



Joined: 17 May 2008
Karma :

PostPosted: 00:14 - 08 Dec 2016    Post subject: Reply with quote

ignore blanks allows you to not select a dropdown, i.e leave the field blank iirc.

the way i would it, assuming the order doesn't matter on the detail sheet is sort the detail sheet so that the blanks appear at the bottom.

The other way I can think about doing it would be creating a VBA function that recreates the list on worksheet update. Bit of a pain as you have to do all the heavy lifting yourself due to VBA not having any useful helper methods.
____________________
Duke 390
Previous: '05 XR125L | '96 XJ600S Diversion |'05 Suzuki GSXR1000 | '05 Honda CBR125-R | '97 YZF 600R Thundercat | '11 Honda CBR250
Car: Jeep Wrangler 4.0L
 Back to top
View user's profile Send private message You must be logged in to rate posts

The Shaggy D.A.
Super Spammer



Joined: 12 Sep 2008
Karma :

PostPosted: 09:06 - 08 Dec 2016    Post subject: Reply with quote

Problem solved, inactive header entries moved to a third archive sheet Smile
____________________
Chances are quite high you are not in my Monkeysphere, and I don't care about you. Don't take it personally.
Currently : Royal Enfield 350 Meteor
Previously : CB100N > CB250RS > XJ900F > GT550 > GPZ750R/1000RX > AJS M16 > R100RT > Bullet 500 > CB500 > LS650P > Bullet Electra X & YBR125 > Bullet 350 "Superstar" & YBR125 Custom > Royal Enfield Classic 500 Despatch Limited Edition (28 of 200) & CB Two-Fifty Nighthawk > ER5
 Back to top
View user's profile Send private message You must be logged in to rate posts

adriansk
Nova Slayer



Joined: 11 May 2016
Karma :

PostPosted: 00:19 - 09 Dec 2016    Post subject: Reply with quote

You can delete all blank rows by selecting your column, press F5, then Special, check Blanks, then OK. Then right click on one of the blank cells and select Delete.
____________________
CBR600F4
 Back to top
View user's profile Send private message You must be logged in to rate posts

The Shaggy D.A.
Super Spammer



Joined: 12 Sep 2008
Karma :

PostPosted: 08:43 - 09 Dec 2016    Post subject: Reply with quote

adriansk wrote:
You can delete all blank rows by selecting your column, press F5, then Special, check Blanks, then OK. Then right click on one of the blank cells and select Delete.


https://images.gr-assets.com/hostedimages/1424835484ra/13807341.gif
____________________
Chances are quite high you are not in my Monkeysphere, and I don't care about you. Don't take it personally.
Currently : Royal Enfield 350 Meteor
Previously : CB100N > CB250RS > XJ900F > GT550 > GPZ750R/1000RX > AJS M16 > R100RT > Bullet 500 > CB500 > LS650P > Bullet Electra X & YBR125 > Bullet 350 "Superstar" & YBR125 Custom > Royal Enfield Classic 500 Despatch Limited Edition (28 of 200) & CB Two-Fifty Nighthawk > ER5
 Back to top
View user's profile Send private message You must be logged in to rate posts

Andy_Pagin
World Chat Champion



Joined: 08 Nov 2010
Karma :

PostPosted: 09:28 - 09 Dec 2016    Post subject: Reply with quote

This is a classic example of spreadsheets being a two edged sword. They allow non-IT people* to create fairly fancy 'applications', but eventually you hit a point where you need to do something seemingly simple like this and find the spreadheet app cannot do it. Now your stuck because no-one in the company has any real programming skills or knowledge of anything but spreadsheets.

It's not just Excel, all spreadsheet apps stall like this.

*I'm not implying that The Shaggy D.A. is thick, just illustrating the problem.
____________________
They're coming to take me away, ho-ho, hee-hee, ha-haaa, hey-hey,
the men in white coats are coming to take me away.
Yamaha Vity -> YBR125 -> FZS600 Fazer -> FZ1-S Fazer
 Back to top
View user's profile Send private message Send e-mail You must be logged in to rate posts

The Shaggy D.A.
Super Spammer



Joined: 12 Sep 2008
Karma :

PostPosted: 11:07 - 09 Dec 2016    Post subject: Reply with quote

My biggest problem was wording my Google query in such a way that would give me decent results. Any hint of "drop down" "validation" "conditional" "vlookup" "index" and it returns the same results. I might have found what I wanted on page 20, but I lost the will to live after about an hour.

Serves me right for trying to build a relational database in Excel.

[edit] Looks like there's an add-in called PowerPivot that lets you set up table relationships :-

https://support.office.com/en-gb/article/Power-Pivot-Add-in-a9c2c6e2-cc49-4976-a7d7-40896795d045#__toc262226430

Might as well just use Access though.
____________________
Chances are quite high you are not in my Monkeysphere, and I don't care about you. Don't take it personally.
Currently : Royal Enfield 350 Meteor
Previously : CB100N > CB250RS > XJ900F > GT550 > GPZ750R/1000RX > AJS M16 > R100RT > Bullet 500 > CB500 > LS650P > Bullet Electra X & YBR125 > Bullet 350 "Superstar" & YBR125 Custom > Royal Enfield Classic 500 Despatch Limited Edition (28 of 200) & CB Two-Fifty Nighthawk > ER5
 Back to top
View user's profile Send private message You must be logged in to rate posts

GSTEEL32
Traffic Copper



Joined: 24 Feb 2010
Karma :

PostPosted: 19:49 - 09 Dec 2016    Post subject: Reply with quote

The Shaggy D.A. wrote:


Serves me right for trying to build a relational database in Excel.


Might as well just use Access though.


Yup. At this point I move to access. My usual problem at this stage is getting excel users to swap over. People fear databases. Nightmare.
 Back to top
View user's profile Send private message Send e-mail You must be logged in to rate posts
Old Thread Alert!

The last post was made 8 years, 249 days ago. Instead of replying here, would creating a new thread be more useful?
  Display posts from previous:   
This page may contain affiliate links, which means we may earn a small commission if a visitor clicks through and makes a purchase. By clicking on an affiliate link, you accept that third-party cookies will be set.

Post new topic   Reply to topic    Bike Chat Forums Index -> The Geek Zone All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Read the Terms of Use! - Powered by phpBB © phpBB Group
 

Debug Mode: ON - Server: birks (www) - Page Generation Time: 0.11 Sec - Server Load: 1.75 - MySQL Queries: 14 - Page Size: 81.84 Kb