Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-20-2017, 02:52 PM
EAPurves EAPurves is offline How to code data eg if more than one dept has a 1 or 2 in it Windows 10 How to code data eg if more than one dept has a 1 or 2 in it Office 2010 32bit
Novice
How to code data eg if more than one dept has a 1 or 2 in it
 
Join Date: Jan 2017
Posts: 2
EAPurves is on a distinguished road
Default How to code data eg if more than one dept has a 1 or 2 in it

Using Windows 10 and Excel 2010 32 bit - hope the following makes sense.

I have information in a single worksheet which needs to be coded into different types of information - a, a1, a9, b, b1, b9, c, c1, c9, d, d1, d9. The attached spreadsheet is a sample of the original spreadsheet - in the original spreadsheet there could be up to 6 depts with between 1 and 6 sections in each.

Column A contains a name, Column B and C contain data relating to information that is taken into account in the coding of a letter, eg, a, b, c, d.

Columns D and I are check total columns and not needed in the analysis.

Columns E to H contain data either 1 or 0 which need to be analysed and therefore coded with either a 1, 9 or blank.



Columns J to L - summarise cells E to H as follows
column J = dept1a = COUNTIF(E3,1)
column K = dept2a = COUNTIF(F3:G3,1) note this counts 2 columns
column L = dept3a = COUNTIF(H3,1)

Column M (code letter) is derived from columns B and C using the following formula
IF(AND(B3=0,C3=0),"a",IF(AND(B3=0,C3=1),"b",IF(AND (B3=1,C3=0),"c",IF(AND(B3=1,C3=1),"d"))))

The following is the section I need help with
Column N (code no) needs a formula to work out the following using the values in columns J to L.
1 if more than one dept has a 1 or 2 in it return 1, see rows 7, 8, 14 to 17, 21, 26 and 27
2 if one dept has 2 return 9, see rows 9, 18, 22 and 28

Column O (Final code) is derived from concatenating columns M and N unless column N is blank then only use column M using the following formula
IF(N3="",M3,CONCATENATE(M3,N3))

The following fields would be hidden in final spreadsheet (dept1a, dept2a, dept3a, code letter, code no.), ideally I would like not to have to enter more columns, as the original spreadsheet uses columns A to CL.

Also I was wondering whether this should be done using VBA
Attached Files
File Type: xlsx data.xlsx (57.7 KB, 7 views)
Reply With Quote
  #2  
Old 01-20-2017, 11:37 PM
xor xor is offline How to code data eg if more than one dept has a 1 or 2 in it Windows 10 How to code data eg if more than one dept has a 1 or 2 in it Office 2016
Expert
 
Join Date: Oct 2015
Posts: 1,097
xor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to all
Default

If I have understood you correct.
Attached Files
File Type: xlsx Departments.xlsx (57.5 KB, 8 views)
Reply With Quote
  #3  
Old 01-21-2017, 01:40 AM
EAPurves EAPurves is offline How to code data eg if more than one dept has a 1 or 2 in it Windows 10 How to code data eg if more than one dept has a 1 or 2 in it Office 2010 32bit
Novice
How to code data eg if more than one dept has a 1 or 2 in it
 
Join Date: Jan 2017
Posts: 2
EAPurves is on a distinguished road
Thumbs up RE - How to code data eg if more than one dept has a 1 or 2 in it

Thank you very much for your quick response and for this -

With regard to your comments re N6 and N28 you are correct.

I will see if I can adapt the formula to take into account more departments and more sections - so I may come back if I get stuck.

Once again many thanks for your quick response and for the fomula.

E
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Find criteria, then paste- code is overwriting data ufopilot Excel Programming 0 02-18-2016 10:14 PM
How to code data eg if more than one dept has a 1 or 2 in it VBA code to login a web site and extract data to excel edneco Excel Programming 4 07-07-2015 02:05 PM
How to code data eg if more than one dept has a 1 or 2 in it Need code to Parse and arrange data based on heading winmaxservices2 Excel Programming 1 01-01-2015 01:04 AM
How to code data eg if more than one dept has a 1 or 2 in it VBA Code for clean all data from ms word document egyp7 Word VBA 4 05-16-2014 03:59 PM
Using Project in a in-house design dept. mcdseven Project 1 12-04-2011 09:04 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:24 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft