SOLVED

Excel formula

%3CLINGO-SUB%20id%3D%22lingo-sub-2191570%22%20slang%3D%22en-US%22%3EExcel%20formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2191570%22%20slang%3D%22en-US%22%3E%3CP%3EHi%3C%2FP%3E%3CP%3EI%20have%20a%20column%20with%2066%20entries%20of%20different%20areas%20of%20m2.%20How%20can%20I%20sort%20these%20into%205%20groups%2C%20ie.%20under%20100%2C%20100-500%2C%20500-1000%2C1000-10%2C000%2C%2010%2C000%2B.%20Thanks%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2191570%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2191577%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2191577%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F989694%22%20target%3D%22_blank%22%3E%40StevieBrett%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ELet's%20say%20the%20entries%20begin%20in%20A2.%3C%2FP%3E%0A%3CP%3EIn%20another%20cell%20in%20row%202%2C%20enter%20the%20formula%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3DLOOKUP(A2%2C%7B0%2C100%2C500%2C1000%2C10000%7D%2C%7B%22under%20100%22%2C%22100-500%22%2C%22500-1000%22%2C%221000-10%2C000%22%2C%2210%2C000%2B%22%7D)%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20can%20be%20filled%20down.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2191619%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2191619%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F127945%22%20target%3D%22_blank%22%3E%40Hans%20Vogelaar%3C%2FA%3E%26nbsp%3BThanks%2C%20so%20clever%2C%20that%20worked%20by%20spilling%20over%20the%20range%20each%20cell%20falls%20into%2C%20but%20gives%20me%2067%20results%20of%20each%20range.%20Can%20I%20now%20find%20out%20how%20many%20are%20in%20each%20of%20the%205%20ranges%3F%20Thanks%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2191668%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2191668%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F989694%22%20target%3D%22_blank%22%3E%40StevieBrett%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20could%20create%20a%20pivot%20table%20based%20on%20the%20data.%3C%2FP%3E%0A%3CP%3EAdd%20the%20new%20column%20to%20both%20the%20Rows%20area%20and%20the%20Values%20area.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOr%20use%20formulas%20such%20as%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3DCOUNTIFS(A2%3AA67%2C%20%22%26lt%3B100%22)%3C%2FP%3E%0A%3CP%3E%3DCOUNTIFS(A2%3AA67%2C%20%22%26gt%3B%3D100%22%2C%20A2%3AA67%2C%20%22%26lt%3B500%22)%3C%2FP%3E%0A%3CP%3E%3DCOUNTIFS(A2%3AA67%2C%20%22%26gt%3B%3D500%22%2C%20A2%3AA67%2C%20%22%26lt%3B1000%22)%3C%2FP%3E%0A%3CP%3E%3DCOUNTIFS(A2%3AA67%2C%20%22%26gt%3B%3D1000%22%2C%20A2%3AA67%2C%20%22%26lt%3B10000%22)%3C%2FP%3E%0A%3CP%3E%3DCOUNTIFS(A2%3AA67%2C%20%22%26gt%3B%3D10000%22)%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2191704%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2191704%22%20slang%3D%22en-US%22%3EYou%E2%80%99re%20a%20genius%2C%20that%20worked%20a%20treat%2C%20thank%20you.%20Tired%20eyes%20now%20but%20I%20may%20well%20have%20a%20few%20questions%20about%20comparing%20data%20later.%20Where%20did%20you%20learn%20all%20this%3F%20Thanks%2C%20your%20help%20is%20much%20appreciated%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2191787%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2191787%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F989694%22%20target%3D%22_blank%22%3E%40StevieBrett%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI've%20been%20using%20Excel%20for%20over%2030%20years%20now%2C%20so%20I%20have%20a%20lot%20of%20experience.%20And%20I%20learned%20a%20lot%20from%20all%20the%20talented%20people%20who%20help%20others%20on%20forums%20like%20this!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2194363%22%20slang%3D%22en-US%22%3ERe%3A%20Excel%20formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2194363%22%20slang%3D%22en-US%22%3EHi%20Hans%2C%20you%E2%80%99re%20my%20go%20to%20guru%20now!%20I%20have%20a%20spreadsheet%20open%2C%20columns%20go%20up%20to%20BE%2C%20I%20have%20at%20least%2070%20entries%20for%20the%20rows.%20Apart%20from%20reducing%20the%20viewing%20size%20(now%2042%20%25)%20how%20can%20I%20see%20the%20column%20headings%20in%20row%201%20to%20keep%20entering%20the%20data%20in%20the%20lower%20rows%20(hope%20that%20makes%20sense!)%3C%2FLINGO-BODY%3E
Occasional Contributor

Hi

I have a column with 66 entries of different areas of m2. How can I sort these into 5 groups, ie. under 100, 100-500, 500-1000,1000-10,000, 10,000+. Thanks

13 Replies

@StevieBrett 

Let's say the entries begin in A2.

In another cell in row 2, enter the formula

 

=LOOKUP(A2,{0,100,500,1000,10000},{"under 100","100-500","500-1000","1000-10,000","10,000+"})

 

This can be filled down.

@Hans Vogelaar Thanks, so clever, that worked by spilling over the range each cell falls into, but gives me 67 results of each range. Can I now find out how many are in each of the 5 ranges? Thanks

best response confirmed by StevieBrett (Occasional Contributor)
Solution

@StevieBrett 

You could create a pivot table based on the data.

Add the new column to both the Rows area and the Values area.

 

Or use formulas such as

 

=COUNTIFS(A2:A67, "<100")

=COUNTIFS(A2:A67, ">=100", A2:A67, "<500")

=COUNTIFS(A2:A67, ">=500", A2:A67, "<1000")

=COUNTIFS(A2:A67, ">=1000", A2:A67, "<10000")

=COUNTIFS(A2:A67, ">=10000")

You’re a genius, that worked a treat, thank you. Tired eyes now but I may well have a few questions about comparing data later. Where did you learn all this? Thanks, your help is much appreciated

@StevieBrett 

I've been using Excel for over 30 years now, so I have a lot of experience. And I learned a lot from all the talented people who help others on forums like this!

Hi Hans, you’re my go to guru now! I have a spreadsheet open, columns go up to BE, I have at least 70 entries for the rows. Apart from reducing the viewing size (now 42 %) how can I see the column headings in row 1 to keep entering the data in the lower rows (hope that makes sense!)

@StevieBrett 

Activate the View tab of the ribbon.

In the Window group, select Freeze Panes > Freeze Top Row.

Wow, easy as that! But that was just a warm up. So this spreadsheet is results from a survey. To compare different parts....so columns b,c,d,e,f are types of gardens (private, charity etc.), column AE is do they use herbicide (Y or N) How do I work out which how many of each garden type uses herbicide (Y) or doesn’t (N). I guess I just use this formulae then for any other comparisons throughout the sheet to generate graphs? Thanks

@StevieBrett 

Could you attach a small sample workbook without sensitive/proprietary information?

@Hans Vogelaar I’ve sent a basic form of what I’m trying to do, so the type of garden is shown with a 1, herbicide use with a y or n. 

@StevieBrett 

See the attached version.

The second sheet has formulas and a chart.

I also added an alternative layout to the first sheet, and a pivot table based on this layout.

@Hans Vogelaar that’s brilliant, thanks. So it should be possible to compare any of the variables, so private that have cobbles and use herbicide? Sorry to have taken up so much of your time, I really appreciate your help!

@StevieBrett 

 

See the attached version. You can select a variable in A2 and in B2 on Sheet2, and C2 will display the count. The result will only be meaningful for variables (columns) that contain numbers, not for columns that contain text.

If you want to be able to count the latter too, you'd need to change the layout to one that is suitable for creating a pivot table - see the example in my previous reply. Pivot tables are very flexible.