10-15-2007, 10:05 PM | #1 | ||
College Starter
Join Date: Aug 2002
Location: Strong Island, NY
|
Excel Formula Help Part III - Final Question
I am looking for a formula that can use a range of misc. random numbers and count up with a "count"
for instance, if I have a range of these numbers 13056 13026 13055 13055 13055 13055 9734 9734 9734 13340 13340 13337 13335 13335 I would want the formula to come up with = 7. Because even though there are multiple lines with the same number, I would want it to count as 1. Also, I would like for it to be used in an entire range, not just a specific cell or anything like that. For instance, if that range was in column D - I want it to be for D1 : D14 (since there are 14 misc. numbers in this example). Lastly, it will be sorted together, so another "13340" wouldn't be 50 lines further down for instance, all the "13340"'s would be together. Not sure it that would even matter, but I thought I'd add it. Last edited by Ramzavail : 10-16-2007 at 06:39 PM. Reason: Have another question |
||
10-15-2007, 10:06 PM | #2 |
Pro Starter
Join Date: Nov 2000
Location: Troy, NY
|
Easiest to do this with a VBA script... is that an option?
__________________
Quis custodiets ipsos custodes? |
10-15-2007, 10:08 PM | #3 |
College Starter
Join Date: Aug 2002
Location: Strong Island, NY
|
Is there any reason why it couldn't be an option? You can use it in Excel right?
Not being snotty - just trying to understand. Last edited by Ramzavail : 10-15-2007 at 10:08 PM. |
10-15-2007, 10:09 PM | #4 |
H.S. Freshman Team
Join Date: Feb 2006
Location: D/FW
|
You could use a pivot table.
|
10-15-2007, 10:13 PM | #5 |
College Starter
Join Date: Aug 2002
Location: Strong Island, NY
|
Id rather not use a pivot table. Only b/c I want to reuse this formula in multiple places and just refill the data and have the formula be useful in each instance without having the re-pivot table.
|
10-15-2007, 10:14 PM | #6 |
Pro Starter
Join Date: Nov 2000
Location: Troy, NY
|
Formulas are a little more dynamic, but there's no reason not do to a script.
Something like this: Code:
Not 100% sure this will work, but it is close...
__________________
Quis custodiets ipsos custodes? Last edited by RPI-Fan : 10-15-2007 at 10:17 PM. |
10-15-2007, 10:18 PM | #7 |
College Starter
Join Date: Aug 2002
Location: Strong Island, NY
|
I think you lost me.
|
10-15-2007, 10:19 PM | #8 |
Pro Starter
Join Date: Nov 2000
Location: Troy, NY
|
Just go to "View... Toolbars... Control Toolbox", then draw a button anywhere on your sheet. Double-click on the button and paste in that code and it will output the info you want (from Column D) into cell A1.
__________________
Quis custodiets ipsos custodes? Last edited by RPI-Fan : 10-15-2007 at 10:23 PM. |
10-15-2007, 10:25 PM | #9 |
Head Coach
Join Date: Oct 2000
Location: Colorado
|
umm, you could use a simple formula instead, I think
=SUM(IF(FREQUENCY(E1:E10,E1:E10)>0,1)) Last edited by Buccaneer : 10-15-2007 at 10:26 PM. Reason: using E instead of D |
10-15-2007, 10:25 PM | #10 |
College Starter
Join Date: Aug 2002
Location: Strong Island, NY
|
i = 1
Count = 0 LoopCheck = 0 Do Temp = Cells(i, p).Value Temp1 = Cells(i + 1, p).Value if Temp ! = Temp1 then Count = Count + 1 End If i = i + 1 If Temp1 = "" Then LoopCheck = 1 End If Loop While LoopCheck = 0 Cells(1, 1).Value = Count End Sub |
10-15-2007, 10:28 PM | #11 |
College Starter
Join Date: Aug 2002
Location: Strong Island, NY
|
thanks Bucc, looks like that worked.
|
10-15-2007, 10:30 PM | #12 |
Head Coach
Join Date: Oct 2000
Location: Colorado
|
Cool, I do Sum If/IIf stuff a lot in both Excel and Access.
|
10-15-2007, 10:52 PM | #13 |
Pro Starter
Join Date: Nov 2000
Location: Troy, NY
|
Great, I always prefer formulae to scripts.
__________________
Quis custodiets ipsos custodes? |
10-15-2007, 11:36 PM | #14 |
College Starter
Join Date: Aug 2002
Location: Strong Island, NY
|
Ok now that I have the set formula, and lets say its for 14 rows - as discussed above - now what if I copy in 25 rows worth of information, I understand the formula will increase the range as I add rows - but is there a way Excel can add the additional 11 rows while I copy and paste the 25 rows in?
Or do I have to count my rows (this case 11 additional), add the rows needed and then copy and paste? Just wondering if theres a simple way Excel can do it all in one swoop. |
10-15-2007, 11:42 PM | #15 |
Pro Starter
Join Date: Nov 2000
Location: Troy, NY
|
I think if you copy the rows from another worksheet, and then right click somewhere in your list of rows and do "Insert Copied Cells" it will automatically update the formula to include the inserted rows. Not sure if it will work if you append the rows at the end, but if you put them in the middle surely it will update.
__________________
Quis custodiets ipsos custodes? |
10-15-2007, 11:49 PM | #16 |
College Starter
Join Date: Aug 2002
Location: Strong Island, NY
|
yes they sorta worked...I can work with that. thanks.
|
10-16-2007, 06:44 PM | #17 |
College Starter
Join Date: Aug 2002
Location: Strong Island, NY
|
Is there a VBA script that I can run that can populate all the information in X amount of tabs and populate it all into one tab?
For instance, if I have 25 tabs with 25 lines in each, can I create a button in the 26th tab and have it populate it with the 625 lines from those 25 tabs in one swoop? |
10-17-2007, 01:17 PM | #18 |
College Starter
Join Date: Aug 2002
Location: Strong Island, NY
|
bumpus maximus
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
|
|