Fiat Coupe Forum
- Founded by Kayjey & James Northam
- Funded by the Club for the benefit of all owners
Fiat Coupe Club UK
join the club
Fiat Coupe Forum
 
» Announced
    Posting images


» Related sites
    Main club site
    fiatcoupe.net


» External data
    owners listed
 
Who's Online Now
2 registered members (GeoffS, 1 invisible), 243 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Forum Statistics
Forums69
Topics113,611
Posts1,341,243
Members1,804
Most Online731
Jan 14th, 2020
Top Posters(All Time)
barnacle 33,563
stan 32,122
Theresa 23,301
PeteP 21,520
bockers 21,071
JimO 17,917
Nigel 17,367
Edinburgh 16,817
RSS Feeds
Club Events
Club Information
Track Events
Rolling Road/RWYB
Social Events
Non-UK Events
Coupé Related Chat
Coupé Spotting
Coupé News/Press
Buying/Selling Advice
Insuring a Coupé
Basic FAQ's
How to Guides
Forum Issues
Technical Problems
General Maintenance
Styling
Tuning
Handling
ICE and Alarm
Coupés for Sale
Coupés Wanted
Parts for Sale
Parts Wanted
Group Buys
Business Forum
Other Vehicles for Sale/Wanted
Other Items for Sale/Wanted
Haggling/Offers
Ebay links
Other Cars
Other Websites
General Chat
Previous Thread
Next Thread
Print Thread
Excel problem #1578759
29/06/2016 10:17
29/06/2016 10:17
Joined: Feb 2006
Posts: 5,390
Essex
Trappy Offline OP
Forum is my life
Trappy  Offline OP
Forum is my life

Joined: Feb 2006
Posts: 5,390
Essex
This one has got me stumped and will take some explaining... Here’s it is.

Our Document Control team has been using a spreadsheet to generate document numbers for two years cry. These document numbers are comprised of three parts (site, type and number). The number part is unique to the site and number. Here's an example of how it essentially looks.

Code:
 Site	Type	No	Full number
SiteA	PDF	1	SiteA-PDF-1
SiteA	PDF	2	SiteA-PDF-2
SiteA	PDF	3	SiteA-PDF-3
SiteA	DOC	1	SiteA-DOC-1
SiteA	DOC	2	SiteA-DOC-2
SiteA	DOC	3	SiteA-DOC-3
SiteA	DOC	4	SiteA-DOC-4
SiteA	DOC	5	SiteA-DOC-5
SiteB	PDF	1	SiteB-PDF-1
SiteB	PDF	2	SiteB-PDF-2
SiteB	PDF	3	SiteB-PDF-3
SiteB	DOC	1	SiteB-DOC-1
SiteB	DOC	2	SiteB-DOC-2
SiteB	DOC	3	SiteB-DOC-3
SiteB	DOC	4	SiteB-DOC-4
SiteB	DOC	5	SiteB-DOC-5
SiteB	DOC	6	SiteB-DOC-6


Now, because they have made a pigs ear of it, they've ended up with a situation in which some numbers have been missed and I need to fix it. Here's what I'm doing.

Code:
Site	Type	No	Site-Type		Full number	Count of Site-Type	Max of Site-Type
SiteA	PDF	1	SiteA-PDF		SiteA-PDF-1	1	3
SiteA	PDF	2	SiteA-PDF		SiteA-PDF-2	2	3
SiteA	PDF	3	SiteA-PDF		SiteA-PDF-3	3	3
SiteA	DOC	1	SiteA-DOC		SiteA-DOC-1	1	5
SiteA	DOC	3	SiteA-DOC		SiteA-DOC-3	2	5
SiteA	DOC	4	SiteA-DOC		SiteA-DOC-4	3	5
SiteA	DOC	5	SiteA-DOC		SiteA-DOC-5	4	5
SiteB	PDF	1	SiteB-PDF		SiteB-PDF-1	1	3
SiteB	PDF	2	SiteB-PDF		SiteB-PDF-2	2	3
SiteB	PDF	3	SiteB-PDF		SiteB-PDF-3	3	3
SiteB	DOC	2	SiteB-DOC		SiteB-DOC-2	1	6
SiteB	DOC	3	SiteB-DOC		SiteB-DOC-3	2	6
SiteB	DOC	5	SiteB-DOC		SiteB-DOC-5	3	6
SiteB	DOC	6	SiteB-DOC		SiteB-DOC-6	4	6
SiteB	DOC		SiteB-DOC				
			


I've developed a formula that counts the number of instances of a particular Site-Type combination so I can simply add one to it to get the next number. Unfortunately, because of the numbers they've missed off, it won't work. The 'Count of Site-Type' column shows where the missing numbers cause the issue - they're different to the assigned numbers in some cases. The 'Max of Site-Type' column returns the current highest number that has been assigned to that Site-Type. The two columns show the difference - in some case this is hundreds on the spreadsheet... I call them the 'Document Out of Control' team...

For reference, here are the two formulae..

Count of Site-Type formula (I'd like this to generate the numbers in future when it's been 'fixed')
=COUNTIF(D$2:D2,D2))

Max of site type formula (this
={MAX(IF($D$2:$D$15=D2,$C$2:$C$15))}

I need either:

A formula that will check for missing numbers and add them first before carrying on afterwards

OR

A formula that find the highest existing number for a site and doc type combo and simply add to carry on and forget the missing numbers...

Any ideas?


F****** b****** thing...
Re: Excel problem [Re: Trappy] #1578762
29/06/2016 10:32
29/06/2016 10:32
Joined: Dec 2014
Posts: 416
uk
OnlyItalian Offline
Enjoying the ride
OnlyItalian  Offline
Enjoying the ride

Joined: Dec 2014
Posts: 416
uk
Create a user defined function in VBA to do what you need.

Last edited by OnlyItalian; 29/06/2016 10:33.

"Proud owner of LE141 and a 99 VIS broomie "
Re: Excel problem [Re: Trappy] #1578767
29/06/2016 11:16
29/06/2016 11:16
Joined: Dec 2005
Posts: 8,416
Lightwater, Surrey
DaveG Offline
Club Treasurer Member 311
DaveG  Offline
Club Treasurer Member 311
Je suis un Coupé

Joined: Dec 2005
Posts: 8,416
Lightwater, Surrey
Why does it need to be "fixed"? If you go back after all this time and number new documents with the missing numbers, they will be out-of-sequence time-wise? But maybe that doesn't matter?

Anyway, if you just forget the missing numbers, you can use the "max" column (assume in column G) with this formula to give you the next number:

=INDEX($G$2:$G$15,MATCH(A18&"-"&B18,$D$2:$D$15,0))+1

where
cell A18 is input for site (SiteA or SiteB)
cell B18 is document type (PDF or DOC)

The other option to start using the missing numbers until there's none left will take a bit more thought...


1996 Portofino 20vt & 2000 Pearl White Plus
1985½ & 2016 2017 Fiat 124 Spider + XF Sportbrake
Re: Excel problem [Re: Trappy] #1578773
29/06/2016 13:54
29/06/2016 13:54
Joined: Dec 2005
Posts: 8,416
Lightwater, Surrey
DaveG Offline
Club Treasurer Member 311
DaveG  Offline
Club Treasurer Member 311
Je suis un Coupé

Joined: Dec 2005
Posts: 8,416
Lightwater, Surrey
If you add further columns H ("out of seq") and I ("missing) and put the following formulas in

cell H2: =IF(F2<C2,F2,"")
cell I2: =IF(ISNA(MATCH(D2&"-"&H2,$E$2:$E$15,0)),H2,"")

and copy down to row 15

In column I you should have the missing document numbers

Or in column J, a combined check that will give the full document details:

cell J2: =IF(ISNA(MATCH(D2&"-"&IF(F2<C2,F2,""),$E$2:$E$15,0)),IF(F2<C2,D2&"-"&F2,""),"")

and again copy down to row 15. Should get something like this:

Code:
Site	Type	No	Site-Type	Full number	correct	max	out of seq	missing	missing
SiteA	PDF	1	SiteA-PDF	SiteA-PDF-1	1	6			
SiteA	PDF	2	SiteA-PDF	SiteA-PDF-2	2	3			
SiteA	PDF	3	SiteA-PDF	SiteA-PDF-3	3	3			
SiteA	DOC	1	SiteA-DOC	SiteA-DOC-1	1	5			
SiteA	DOC	3	SiteA-DOC	SiteA-DOC-3	2	5	2	2	SiteA-DOC-2
SiteA	DOC	4	SiteA-DOC	SiteA-DOC-4	3	5	3		
SiteA	DOC	5	SiteA-DOC	SiteA-DOC-5	4	5	4		
SiteB	PDF	1	SiteB-PDF	SiteB-PDF-1	1	3			
SiteB	PDF	2	SiteB-PDF	SiteB-PDF-2	2	3			
SiteB	PDF	3	SiteB-PDF	SiteB-PDF-3	3	3			
SiteB	DOC	2	SiteB-DOC	SiteB-DOC-2	1	6	1	1	SiteB-DOC-1
SiteB	DOC	3	SiteB-DOC	SiteB-DOC-3	2	6	2		
SiteB	DOC	5	SiteB-DOC	SiteB-DOC-5	3	6	3		
SiteB	DOC	6	SiteB-DOC	SiteB-DOC-6	4	6	4	4	SiteB-DOC-4
									
Next document									
SiteA	PDF	7	if carry on						


1996 Portofino 20vt & 2000 Pearl White Plus
1985½ & 2016 2017 Fiat 124 Spider + XF Sportbrake

Powered by UBB.threads™ PHP Forum Software 7.7.1
(Release build 20190129)
PHP: 7.3.33 Page Time: 0.011s Queries: 15 (0.004s) Memory: 0.7565 MB (Peak: 0.8258 MB) Data Comp: Off Server Time: 2024-05-05 19:01:50 UTC