![]() |
|
![]() |
|
Thread Tools | Display Modes |
|
#1
|
||||
|
||||
![]() Good morning! I have a worksheet for managing components in individual modules. So, each module title is a 'locked' row followed by rows for each component of that module. Module Titles are in column A Component Numbers are in column C I need to count the number of components of each module. I have been trying to write a formula to count the cells of column C that are 'between' two different values in column A. I have painfully figured out basic counting formulas for other data in this worksheet but have not had to create 'count if between', 'ranges' or 'IF this, and this, then Count this' type formulas. Can anyone help me out? |
#2
|
||||
|
||||
![]()
I would do this with Power Query aka Get and Transform Data on the Data Tab. Once in PQ, use the GroupBy function to count the numbers. If you post a sample document, then I can provide the specific steps and code. I cannot manipulate data in a picture. Attach a sample file that is representative of your actual file making sure to anonymize any confidential data.
__________________
Alan עַם יִשְׂרָאֵל חַ Using O365 v2505 |
#3
|
||||
|
||||
![]()
Alansidman,
Thank you for the assist! Here is an example. I need to count the (non-blank) cells in the 'WORK CARD NUMBER' column (C), that follow the Module Title in the 'MODULE NUMBER ABD PREFIX' column (A). So, how many Work Cards are in Module 1-GP, how many Work Cards are in Module 2-PD, etc... |
#4
|
||||
|
||||
![]()
See table at cell B1136 of the attached.
Are they the correct values? If so, we can explain more fully. |
#5
|
||||
|
||||
![]()
That's it! Perfect! How did you pull it off?
|
#6
|
||||
|
||||
![]()
I used Power Query (Get & Transform Data) on the Data tab of the ribbon.
First I named the range you want to process A6:L1130 and called it myData (I did this to prevent Power Query converting the data into a proper Excel table). Then with that range selected went into Power Query by clicking the From Table/Range button on the ribbon: 2024-07-17_140736.jpg which brings up the Power Query window: 2024-07-17_143508.jpg where I went through a few steps (on the right in the picture):
You need to make sure that when you change the data in your source data that (a) the named range myData covers it all and (b) you'll need to refresh the result table by right-clicking somewhere on it and choosing Refresh. |
#7
|
||||
|
||||
![]()
Wow, that's a lot of beyond what I have done in the past!
Okay, I sort of follow you through the process. With the exception of where/how I name my selected data. If I click 'From Table/Range' of course it opens the 'Create Table' pop-up. I must be missing something... |
#8
|
||||
|
||||
![]()
Never mind... Duh... R-Click, Define Name, yes?
|
#9
|
||||
|
||||
![]()
Select the range you want to process A6:L1130, then in name box here, type the name (if the name doesn't already exist you'll see the cell address A6, which you overwrite):
2024-07-17_170309.jpg 2024-07-17_170543.jpg Changing its extent is a bit different if it already exists. You can go into Name Manager on the Formulas tab of the ribbon: 2024-07-17_170752.jpg and either delete it in the dialogue box, then go back into the sheet and recreate it as before, or you can edit it directly in the dialogue box: 2024-07-17_171543.jpg |
#10
|
||||
|
||||
![]()
Okay, what Custom Column Formula did you use to create the 'IsHdrRow' column?
|
#11
|
||||
|
||||
![]()
2024-07-17_173726.jpg
or you could use the user interface and go into Add column, then Conditional column and fill in for example as follows: 2024-07-17_174119.jpg which results in the likes of: Code:
= Table.AddColumn(#"Removed Blank Rows", "IsHdr", each if [MODULE NUMBER AND PREFIX] = null then false else true) |
#12
|
||||
|
||||
![]()
I think it worked... IT DID! IT WORKED! p45cal, YOU ARE THE MAN! THANK YOU!!!!!
One more question, the result provided two columns, and I mistakenly told the 'Close and Load to..' function to populate both columns in my target. I only need the 'MyCount' column to populate my target. I managed to remove the results from my target, but I can't find how to reset the load data to load only the 'MyCount' column to my target... |
#13
|
||||
|
||||
![]()
Yea, the only option I have post-load is 'Close and Load'...
|
#14
|
||||
|
||||
![]()
I'm not at all clear; what is your 'target'?
|
#15
|
||||
|
||||
![]()
Apologies! I am 'loading' the results data into another tab in the same worksheet. There are a total of five tabs, one for each aircraft, in this worksheet.
Essentially, with your much appreciated help, I am building a comparison sheet to show results data of each tab side-by-side to determine what is missing/incorrect in each tab. So, my target is another tab in the worksheet... Last edited by SnakeDoctor; 07-17-2024 at 12:23 PM. Reason: Mistake... |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Copying column to another column with deleting date due to blank cells | Sportsmen | Excel | 3 | 04-18-2023 06:16 AM |
![]() |
oscarlimerick | Excel | 4 | 03-14-2022 12:22 AM |
Auto-Entering Values into a Column in a Table based on Value in Adjacent Column | nytvsh | Excel | 2 | 12-06-2021 12:33 AM |
Formula to check combinations of values in one column to find match from another column | kong1802 | Excel | 1 | 06-15-2018 05:26 AM |
![]() |
Straitsfan | Excel | 1 | 08-09-2016 05:28 AM |