corsasport.co.uk
 

Corsa Sport » Message Board » Off Day » Geek Day » Need an Excel expert


New Topic

New Poll
  <<  1    2  >> Subscribe | Add to Favourites

You are not logged in and may not post or reply to messages. Please log in or create a new account or mail us about fixing an existing one - register@corsasport.co.uk

There are also many more features available when you are logged in such as private messages, buddy list, location services, post search and more.


Author Need an Excel expert
Balling
Premium Member

Avatar

Registered: 7th Apr 04
Location: Denmark
User status: Offline
17th Jun 15 at 08:18   View Garage View User's Profile U2U Member Reply With Quote

A few of you are Excel experts I know, so here's a bit of a challenge if you like.

I need a formula that gives the following output:
R201A01
R201A02
R201A03
R201A04
R201A05
R201A06
R201B01
R201B02
R201B03
R201B04
R201B05
R201B06
R201C01
R201C02
[snip]
R201E05
R201E06
R202A01
R202A02
[snip]
R220E05
R220E06

So...

Last number counts from 01 to 06.
Then letter is increased from A to E.
Then first number counts from 201 to 220.

Can it be done?


Dom
Member

Registered: 13th Sep 03
User status: Offline
17th Jun 15 at 08:29   View User's Profile U2U Member Reply With Quote

Does it need to be an Excel formula or could you use a macro/VBA?
If the latter, then you can do it with a number of nested 'for loops'

Edit - Otherwise it's a case of dismantling the previous cells string using the 'mid' function, incrementing individual segments and then using 'if statements' to reset. VBA is far easier

[Edited on 17-06-2015 by Dom]
Balling
Premium Member

Avatar

Registered: 7th Apr 04
Location: Denmark
User status: Offline
17th Jun 15 at 08:58   View Garage View User's Profile U2U Member Reply With Quote

quote:
Originally posted by Dom
could you use a macro/VBA?
I don't know, could I?

Way out of my comfort zone here.


pow
Premium Member

Avatar

Registered: 11th Sep 06
Location: Hazlemere, Buckinghamshire
User status: Offline
17th Jun 15 at 09:49   View Garage View User's Profile U2U Member Reply With Quote

Am I simplifying it too much by saying concatenate it?
Balling
Premium Member

Avatar

Registered: 7th Apr 04
Location: Denmark
User status: Offline
17th Jun 15 at 09:51   View Garage View User's Profile U2U Member Reply With Quote

Could I break it down in to different columns somehow?

Column A:
R201 (+1 every 30 rows)

Column B:
A (+1 every 5 rows, starting over at E)

Column C:
01 (+1 every 1 row, starting over at 6)

Column D:
"=A1&B1&C1"

All I'd need is the formula for the three columns. Or am I dreamin?


Balling
Premium Member

Avatar

Registered: 7th Apr 04
Location: Denmark
User status: Offline
17th Jun 15 at 09:52   View Garage View User's Profile U2U Member Reply With Quote

quote:
Originally posted by pow
Am I simplifying it too much by saying concatenate it?
Depends what that means.


pow
Premium Member

Avatar

Registered: 11th Sep 06
Location: Hazlemere, Buckinghamshire
User status: Offline
17th Jun 15 at 09:52   View Garage View User's Profile U2U Member Reply With Quote

Exactly what I meant balling
pow
Premium Member

Avatar

Registered: 11th Sep 06
Location: Hazlemere, Buckinghamshire
User status: Offline
17th Jun 15 at 09:53   View Garage View User's Profile U2U Member Reply With Quote

Give me an email address I'll fire something over
Balling
Premium Member

Avatar

Registered: 7th Apr 04
Location: Denmark
User status: Offline
17th Jun 15 at 10:07   View Garage View User's Profile U2U Member Reply With Quote

Cheers!

Email is in my profile.


pow
Premium Member

Avatar

Registered: 11th Sep 06
Location: Hazlemere, Buckinghamshire
User status: Offline
17th Jun 15 at 10:22   View Garage View User's Profile U2U Member Reply With Quote

Sent.
Brett
Premium Member

Avatar

Registered: 16th Dec 02
Location: Manchester
User status: Offline
17th Jun 15 at 10:31   View Garage View User's Profile U2U Member Reply With Quote

I'd like to see the finished formula please
Balling
Premium Member

Avatar

Registered: 7th Apr 04
Location: Denmark
User status: Offline
17th Jun 15 at 10:44   View Garage View User's Profile U2U Member Reply With Quote

quote:
Originally posted by pow
Sent.
You're a legend!

But as Brett says, how?

I probably need to do a new string in a year, so unless you want me to just email you I'd love to have the formula.


pow
Premium Member

Avatar

Registered: 11th Sep 06
Location: Hazlemere, Buckinghamshire
User status: Offline
17th Jun 15 at 10:53   View Garage View User's Profile U2U Member Reply With Quote

Just using Excel 2013 I made the pattern by copy pasting, then =CONCATENATE("B",A1,B1,C1)
Balling
Premium Member

Avatar

Registered: 7th Apr 04
Location: Denmark
User status: Offline
17th Jun 15 at 10:55   View Garage View User's Profile U2U Member Reply With Quote

So you filled in the A, B and C columns manually?


Brett
Premium Member

Avatar

Registered: 16th Dec 02
Location: Manchester
User status: Offline
17th Jun 15 at 10:58   View Garage View User's Profile U2U Member Reply With Quote

Right, so no formula really at all
Brett
Premium Member

Avatar

Registered: 16th Dec 02
Location: Manchester
User status: Offline
17th Jun 15 at 13:59   View Garage View User's Profile U2U Member Reply With Quote

=CONCATENATE("R2",TEXT(INT((ROW()-1)/30)+1,"00"),CHAR(64+MOD(QUOTIENT(ROW()-1,6),5)+1),TEXT(IF(MOD(ROW(),6)=0,"6",MOD(ROW(),6)),"00"))
Ellis
Member

Registered: 11th Sep 07
Location: Aberdeenshire
User status: Offline
17th Jun 15 at 14:00   View User's Profile U2U Member Reply With Quote

quote:
Originally posted by Brett
=CONCATENATE("R2",TEXT(INT((ROW()-1)/30)+1,"00"),CHAR(64+MOD(QUOTIENT(ROW()-1,6),5)+1),TEXT(IF(MOD(ROW(),6)=0,"6",MOD(ROW(),6)),"00"))
Ian
Site Administrator

Avatar

Registered: 28th Aug 99
Location: Liverpool
User status: Online
17th Jun 15 at 14:04   View Garage View User's Profile U2U Member Reply With Quote

Was going to suggest MOD

Have a big long column that's a regular count then mod that to give you the periods.

I'd be using CHAR to give you the letters as well, add 64 on to get to A.
Brett
Premium Member

Avatar

Registered: 16th Dec 02
Location: Manchester
User status: Offline
17th Jun 15 at 14:08   View Garage View User's Profile U2U Member Reply With Quote

It does
Ian
Site Administrator

Avatar

Registered: 28th Aug 99
Location: Liverpool
User status: Online
17th Jun 15 at 14:18   View Garage View User's Profile U2U Member Reply With Quote

="R2"&IF(INT(A1/156)+1<10,"0","")&INT(A1/156)+1&CHAR(65+INT(MOD(A1-1,30)/6))&IF(MOD(A1-1,6)+1<10,"0","")&MOD(A1-1,6)+1

That's wrong but you get the idea.
Brett
Premium Member

Avatar

Registered: 16th Dec 02
Location: Manchester
User status: Offline
17th Jun 15 at 14:20   View Garage View User's Profile U2U Member Reply With Quote

Mine works as required and doesn't require cell refs?
Ian
Site Administrator

Avatar

Registered: 28th Aug 99
Location: Liverpool
User status: Online
17th Jun 15 at 14:21   View Garage View User's Profile U2U Member Reply With Quote



I just wanted a go
Brett
Premium Member

Avatar

Registered: 16th Dec 02
Location: Manchester
User status: Offline
17th Jun 15 at 14:24   View Garage View User's Profile U2U Member Reply With Quote

Fair enough Boss
Brett
Premium Member

Avatar

Registered: 16th Dec 02
Location: Manchester
User status: Offline
17th Jun 15 at 14:28   View Garage View User's Profile U2U Member Reply With Quote

In fact Ian, if you want to join in, I missed the bit about it starting again after 220 CBA, got work to do.
Balling
Premium Member

Avatar

Registered: 7th Apr 04
Location: Denmark
User status: Offline
17th Jun 15 at 15:11   View Garage View User's Profile U2U Member Reply With Quote

quote:
Originally posted by Brett
=CONCATENATE("R2",TEXT(INT((ROW()-1)/30)+1,"00"),CHAR(64+MOD(QUOTIENT(ROW()-1,6),5)+1),TEXT(IF(MOD(ROW(),6)=0,"6",MOD(ROW(),6)),"00"))
Sweet!

Needed to switch all the commas to semicolons to get it working with Excel for Mac, but other than that it seems flawless.



  <<  1    2  >>
New Topic

New Poll

  Related Threads Author Forum Replies Views Last Post
is there a program that...... chris_uk Geek Day 6 1903
16th Jun 05 at 00:47
by Dan B
 
Excel Help AndyKent Geek Day 3 1461
6th Oct 07 at 10:22
by aPk
 
need an excel like programme (for free) Shane Geek Day 12 1775
13th May 08 at 14:55
by pow
 
Microsoft Excel strick206 Geek Day 10 1486
6th Jul 11 at 14:46
by Sam
 
Excel sheet needed, can anyone help? Dan Geek Day 15 942
17th Jun 12 at 23:39
by Brett
 

Corsa Sport » Message Board » Off Day » Geek Day » Need an Excel expert 29 database queries in 0.0158420 seconds