Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-16-2024, 09:10 AM
SnakeDoctor's Avatar
SnakeDoctor SnakeDoctor is offline Counting populated cells (range) in one column, that fall between 2 (diff) values in another column Windows 11 Counting populated cells (range) in one column, that fall between 2 (diff) values in another column Office 2021
Advanced Beginner
Counting populated cells (range) in one column, that fall between 2 (diff) values in another column
 
Join Date: Jul 2023
Location: Ft. Worth, TX
Posts: 38
SnakeDoctor is on a distinguished road
Default Counting populated cells (range) in one column, that fall between 2 (diff) values in another column


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?
Attached Images
File Type: png Talley.png (47.9 KB, 32 views)
Reply With Quote
  #2  
Old 07-16-2024, 11:13 AM
Alansidman's Avatar
Alansidman Alansidman is offline Counting populated cells (range) in one column, that fall between 2 (diff) values in another column Windows 11 Counting populated cells (range) in one column, that fall between 2 (diff) values in another column Office 2021
עַם יִשְׂרָאֵל חַי
 
Join Date: Apr 2019
Location: Steamboat Springs
Posts: 112
Alansidman has a spectacular aura aboutAlansidman has a spectacular aura aboutAlansidman has a spectacular aura about
Default

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
Reply With Quote
  #3  
Old 07-16-2024, 11:59 AM
SnakeDoctor's Avatar
SnakeDoctor SnakeDoctor is offline Counting populated cells (range) in one column, that fall between 2 (diff) values in another column Windows 11 Counting populated cells (range) in one column, that fall between 2 (diff) values in another column Office 2021
Advanced Beginner
Counting populated cells (range) in one column, that fall between 2 (diff) values in another column
 
Join Date: Jul 2023
Location: Ft. Worth, TX
Posts: 38
SnakeDoctor is on a distinguished road
Default Example Worksheet

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...
Attached Files
File Type: xlsx EXAMPLE.xlsx (101.4 KB, 6 views)
Reply With Quote
  #4  
Old 07-16-2024, 01:45 PM
p45cal's Avatar
p45cal p45cal is offline Counting populated cells (range) in one column, that fall between 2 (diff) values in another column Windows 10 Counting populated cells (range) in one column, that fall between 2 (diff) values in another column Office 2021
Expert
 
Join Date: Apr 2014
Posts: 948
p45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond repute
Default

See table at cell B1136 of the attached.
Are they the correct values?
If so, we can explain more fully.
Attached Files
File Type: xlsx msofficeforums52670EXAMPLE.xlsx (111.3 KB, 7 views)
Reply With Quote
  #5  
Old 07-17-2024, 05:04 AM
SnakeDoctor's Avatar
SnakeDoctor SnakeDoctor is offline Counting populated cells (range) in one column, that fall between 2 (diff) values in another column Windows 11 Counting populated cells (range) in one column, that fall between 2 (diff) values in another column Office 2021
Advanced Beginner
Counting populated cells (range) in one column, that fall between 2 (diff) values in another column
 
Join Date: Jul 2023
Location: Ft. Worth, TX
Posts: 38
SnakeDoctor is on a distinguished road
Default

That's it! Perfect! How did you pull it off?
Reply With Quote
  #6  
Old 07-17-2024, 06:59 AM
p45cal's Avatar
p45cal p45cal is offline Counting populated cells (range) in one column, that fall between 2 (diff) values in another column Windows 10 Counting populated cells (range) in one column, that fall between 2 (diff) values in another column Office 2021
Expert
 
Join Date: Apr 2014
Posts: 948
p45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond repute
Default

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):
  • Promoted the first row into headers,
  • removed entirely blank rows,
  • added a new column called IsHdrRow which looks to see if the MODULE NUMBER AND PREFIX column is blank or not, if it is then put TRUE else put FALSE,
  • filled down the MODULE NUMBER AND PREFIX column,
  • removed the header rows by filtering the IsHdrRow to leave only the FALSE rows,
  • got rid of the blank rows in the WORK CARD NUMBER column so that merged cells are represented by a single row (this also got rid of Place Holder rows),
  • then I grouped the rows according to column MODULE NUMBER AND PREFIX and got it to give me a count of rows in each group, which is the results table you see.

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.
Reply With Quote
  #7  
Old 07-17-2024, 08:47 AM
SnakeDoctor's Avatar
SnakeDoctor SnakeDoctor is offline Counting populated cells (range) in one column, that fall between 2 (diff) values in another column Windows 11 Counting populated cells (range) in one column, that fall between 2 (diff) values in another column Office 2021
Advanced Beginner
Counting populated cells (range) in one column, that fall between 2 (diff) values in another column
 
Join Date: Jul 2023
Location: Ft. Worth, TX
Posts: 38
SnakeDoctor is on a distinguished road
Default

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...
Reply With Quote
  #8  
Old 07-17-2024, 09:08 AM
SnakeDoctor's Avatar
SnakeDoctor SnakeDoctor is offline Counting populated cells (range) in one column, that fall between 2 (diff) values in another column Windows 11 Counting populated cells (range) in one column, that fall between 2 (diff) values in another column Office 2021
Advanced Beginner
Counting populated cells (range) in one column, that fall between 2 (diff) values in another column
 
Join Date: Jul 2023
Location: Ft. Worth, TX
Posts: 38
SnakeDoctor is on a distinguished road
Default

Never mind... Duh... R-Click, Define Name, yes?
Reply With Quote
  #9  
Old 07-17-2024, 09:21 AM
p45cal's Avatar
p45cal p45cal is offline Counting populated cells (range) in one column, that fall between 2 (diff) values in another column Windows 10 Counting populated cells (range) in one column, that fall between 2 (diff) values in another column Office 2021
Expert
 
Join Date: Apr 2014
Posts: 948
p45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond repute
Default

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
Reply With Quote
  #10  
Old 07-17-2024, 09:33 AM
SnakeDoctor's Avatar
SnakeDoctor SnakeDoctor is offline Counting populated cells (range) in one column, that fall between 2 (diff) values in another column Windows 11 Counting populated cells (range) in one column, that fall between 2 (diff) values in another column Office 2021
Advanced Beginner
Counting populated cells (range) in one column, that fall between 2 (diff) values in another column
 
Join Date: Jul 2023
Location: Ft. Worth, TX
Posts: 38
SnakeDoctor is on a distinguished road
Default

Okay, what Custom Column Formula did you use to create the 'IsHdrRow' column?
Reply With Quote
  #11  
Old 07-17-2024, 09:44 AM
p45cal's Avatar
p45cal p45cal is offline Counting populated cells (range) in one column, that fall between 2 (diff) values in another column Windows 10 Counting populated cells (range) in one column, that fall between 2 (diff) values in another column Office 2021
Expert
 
Join Date: Apr 2014
Posts: 948
p45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond repute
Default

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)
Reply With Quote
  #12  
Old 07-17-2024, 10:19 AM
SnakeDoctor's Avatar
SnakeDoctor SnakeDoctor is offline Counting populated cells (range) in one column, that fall between 2 (diff) values in another column Windows 11 Counting populated cells (range) in one column, that fall between 2 (diff) values in another column Office 2021
Advanced Beginner
Counting populated cells (range) in one column, that fall between 2 (diff) values in another column
 
Join Date: Jul 2023
Location: Ft. Worth, TX
Posts: 38
SnakeDoctor is on a distinguished road
Default

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...
Reply With Quote
  #13  
Old 07-17-2024, 10:22 AM
SnakeDoctor's Avatar
SnakeDoctor SnakeDoctor is offline Counting populated cells (range) in one column, that fall between 2 (diff) values in another column Windows 11 Counting populated cells (range) in one column, that fall between 2 (diff) values in another column Office 2021
Advanced Beginner
Counting populated cells (range) in one column, that fall between 2 (diff) values in another column
 
Join Date: Jul 2023
Location: Ft. Worth, TX
Posts: 38
SnakeDoctor is on a distinguished road
Default

Yea, the only option I have post-load is 'Close and Load'...
Reply With Quote
  #14  
Old 07-17-2024, 11:29 AM
p45cal's Avatar
p45cal p45cal is offline Counting populated cells (range) in one column, that fall between 2 (diff) values in another column Windows 10 Counting populated cells (range) in one column, that fall between 2 (diff) values in another column Office 2021
Expert
 
Join Date: Apr 2014
Posts: 948
p45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond repute
Default

I'm not at all clear; what is your 'target'?
Reply With Quote
  #15  
Old 07-17-2024, 12:16 PM
SnakeDoctor's Avatar
SnakeDoctor SnakeDoctor is offline Counting populated cells (range) in one column, that fall between 2 (diff) values in another column Windows 11 Counting populated cells (range) in one column, that fall between 2 (diff) values in another column Office 2021
Advanced Beginner
Counting populated cells (range) in one column, that fall between 2 (diff) values in another column
 
Join Date: Jul 2023
Location: Ft. Worth, TX
Posts: 38
SnakeDoctor is on a distinguished road
Default

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...
Reply With Quote
Reply



Similar Threads
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
Counting populated cells (range) in one column, that fall between 2 (diff) values in another column display a change in column cells counting the number of months 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
Counting populated cells (range) in one column, that fall between 2 (diff) values in another column Shortcut to haven ascending values in row/column of cells Straitsfan Excel 1 08-09-2016 05:28 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:22 AM.


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