Reverse FREQUENCY formula to use from the top down as opposed to the bottom up

suprsnipes

Active Member
Joined
Apr 26, 2009
Messages
434
Hi,

I am using the following formula in A1 and copying down which works very well. What I would like to know is how can I use the formula in reverse? By that I mean instead of looking to find a consecutive frequency from the bottom up I want to find a consecutive frequency from the top down.

Here is the formula for bottom up.

Code:
=IF(A1<>"",FREQUENCY(IF(A1:A21=A1,ROW(A1:A21)),IF(A1:A21<>A1,ROW(A1:A21))),"")
Regards,
suprsnipes
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Hi,

I am using the following formula in A1 and copying down which works very well. What I would like to know is how can I use the formula in reverse? By that I mean instead of looking to find a consecutive frequency from the bottom up I want to find a consecutive frequency from the top down.

Here is the formula for bottom up.

=IF(A1<>"",FREQUENCY(IF(A1:A21=A1,ROW(A1:A21)),IF(A1:A21<>A1,ROW(A1:A21))),"")

Regards,
suprsnipes
What makes you think that formula works from the bottom up?

Can you post some sample data and let us know what result you expect?
 
Upvote 0
Thanks for your response, again. As per the sample below the working formula is in column B the result that I am looking for is in column D. I have tried modifying the formula but can't get the output I am looking for.

HTML:
[RANGE=cls:xl2bb-100][XR][XH=cs:5]Excel Workbook[/XH][/XR][XR][XH][/XH][XH]A[/XH][XH]B[/XH][XH]C[/XH][XH]D[/XH][/XR][XR][XH]1[/XH][XD=h:l]c[/XD][XD=h:r]4[/XD][XD][/XD][XD=h:r]1[/XD][/XR][XR][XH]2[/XH][XD=h:l]c[/XD][XD=h:r]3[/XD][XD][/XD][XD=h:r]2[/XD][/XR][XR][XH]3[/XH][XD=h:l]c[/XD][XD=h:r]2[/XD][XD][/XD][XD=h:r]3[/XD][/XR][XR][XH]4[/XH][XD=h:l]c[/XD][XD=h:r]1[/XD][XD][/XD][XD=h:r]4[/XD][/XR][XR][XH]5[/XH][XD=h:l]d[/XD][XD=h:r]2[/XD][XD][/XD][XD=h:r]1[/XD][/XR][XR][XH]6[/XH][XD=h:l]d[/XD][XD=h:r]1[/XD][XD][/XD][XD=h:r]2[/XD][/XR][XR][XH]7[/XH][XD=h:l]c[/XD][XD=h:r]2[/XD][XD][/XD][XD=h:r]1[/XD][/XR][XR][XH]8[/XH][XD=h:l]c[/XD][XD=h:r]1[/XD][XD][/XD][XD=h:r]2[/XD][/XR][XR][XH]9[/XH][XD=h:l]d[/XD][XD=h:r]2[/XD][XD][/XD][XD=h:r]1[/XD][/XR][XR][XH]10[/XH][XD=h:l]d[/XD][XD=h:r]1[/XD][XD][/XD][XD=h:r]2[/XD][/XR][XR][XH]11[/XH][XD=h:l]c[/XD][XD=h:r]7[/XD][XD][/XD][XD=h:r]1[/XD][/XR][XR][XH]12[/XH][XD=h:l]c[/XD][XD=h:r]6[/XD][XD][/XD][XD=h:r]2[/XD][/XR][XR][XH]13[/XH][XD=h:l]c[/XD][XD=h:r]5[/XD][XD][/XD][XD=h:r]3[/XD][/XR][XR][XH]14[/XH][XD=h:l]c[/XD][XD=h:r]4[/XD][XD][/XD][XD=h:r]4[/XD][/XR][XR][XH]15[/XH][XD=h:l]c[/XD][XD=h:r]3[/XD][XD][/XD][XD=h:r]5[/XD][/XR][XR][XH]16[/XH][XD=h:l]c[/XD][XD=h:r]2[/XD][XD][/XD][XD=h:r]6[/XD][/XR][XR][XH]17[/XH][XD=h:l]c[/XD][XD=h:r]1[/XD][XD][/XD][XD=h:r]7[/XD][/XR][XR][XH]18[/XH][XD=h:l]d[/XD][XD=h:r]4[/XD][XD][/XD][XD=h:r]1[/XD][/XR][XR][XH]19[/XH][XD=h:l]d[/XD][XD=h:r]3[/XD][XD][/XD][XD=h:r]2[/XD][/XR][XR][XH]20[/XH][XD=h:l]d[/XD][XD=h:r]2[/XD][XD][/XD][XD=h:r]3[/XD][/XR][XR][XH]21[/XH][XD=h:l]d[/XD][XD=h:r]1[/XD][XD][/XD][XD=h:r]4[/XD][/XR][XR][XH=cs:5][RANGE][XR][XD]Sheet1[/XD][XH][/XH][/XR][/RANGE][/XH][/XR][/RANGE][B]Excel 2010[/B][RANGE=cls:xl2bb-extra-100][XR][XH=cs:2]Array Formulas[/XH][/XR][XR][XD]Cell[/XD][XD]Array Formula[/XD][/XR][XR][XD]B1[/XD][XD]=IF(A1<>"",FREQUENCY(IF(A1:A21=A1,ROW(A1:A21)),IF(A1:A21<>A1,ROW(A1:A21))),"")[/XD][/XR][XR][XD]B2[/XD][XD]=IF(A2<>"",FREQUENCY(IF(A2:A21=A2,ROW(A2:A21)),IF(A2:A21<>A2,ROW(A2:A21))),"")[/XD][/XR][XR][XD]B3[/XD][XD]=IF(A3<>"",FREQUENCY(IF(A3:A21=A3,ROW(A3:A21)),IF(A3:A21<>A3,ROW(A3:A21))),"")[/XD][/XR][XR][XD]B4[/XD][XD]=IF(A4<>"",FREQUENCY(IF(A4:A21=A4,ROW(A4:A21)),IF(A4:A21<>A4,ROW(A4:A21))),"")[/XD][/XR][XR][XD]B5[/XD][XD]=IF(A5<>"",FREQUENCY(IF(A5:A21=A5,ROW(A5:A21)),IF(A5:A21<>A5,ROW(A5:A21))),"")[/XD][/XR][XR][XD]B6[/XD][XD]=IF(A6<>"",FREQUENCY(IF(A6:A21=A6,ROW(A6:A21)),IF(A6:A21<>A6,ROW(A6:A21))),"")[/XD][/XR][XR][XD]B7[/XD][XD]=IF(A7<>"",FREQUENCY(IF(A7:A21=A7,ROW(A7:A21)),IF(A7:A21<>A7,ROW(A7:A21))),"")[/XD][/XR][XR][XD]B8[/XD][XD]=IF(A8<>"",FREQUENCY(IF(A8:A21=A8,ROW(A8:A21)),IF(A8:A21<>A8,ROW(A8:A21))),"")[/XD][/XR][XR][XD]B9[/XD][XD]=IF(A9<>"",FREQUENCY(IF(A9:A21=A9,ROW(A9:A21)),IF(A9:A21<>A9,ROW(A9:A21))),"")[/XD][/XR][XR][XD]B10[/XD][XD]=IF(A10<>"",FREQUENCY(IF(A10:A21=A10,ROW(A10:A21)),IF(A10:A21<>A10,ROW(A10:A21))),"")[/XD][/XR][XR][XD]B11[/XD][XD]=IF(A11<>"",FREQUENCY(IF(A11:A21=A11,ROW(A11:A21)),IF(A11:A21<>A11,ROW(A11:A21))),"")[/XD][/XR][XR][XD]B12[/XD][XD]=IF(A12<>"",FREQUENCY(IF(A12:A21=A12,ROW(A12:A21)),IF(A12:A21<>A12,ROW(A12:A21))),"")[/XD][/XR][XR][XD]B13[/XD][XD]=IF(A13<>"",FREQUENCY(IF(A13:A21=A13,ROW(A13:A21)),IF(A13:A21<>A13,ROW(A13:A21))),"")[/XD][/XR][XR][XD]B14[/XD][XD]=IF(A14<>"",FREQUENCY(IF(A14:A22=A14,ROW(A14:A22)),IF(A14:A22<>A14,ROW(A14:A22))),"")[/XD][/XR][XR][XD]B15[/XD][XD]=IF(A15<>"",FREQUENCY(IF(A15:A23=A15,ROW(A15:A23)),IF(A15:A23<>A15,ROW(A15:A23))),"")[/XD][/XR][XR][XD]B16[/XD][XD]=IF(A16<>"",FREQUENCY(IF(A16:A24=A16,ROW(A16:A24)),IF(A16:A24<>A16,ROW(A16:A24))),"")[/XD][/XR][XR][XD]B17[/XD][XD]=IF(A17<>"",FREQUENCY(IF(A17:A25=A17,ROW(A17:A25)),IF(A17:A25<>A17,ROW(A17:A25))),"")[/XD][/XR][XR][XD]B18[/XD][XD]=IF(A18<>"",FREQUENCY(IF(A18:A26=A18,ROW(A18:A26)),IF(A18:A26<>A18,ROW(A18:A26))),"")[/XD][/XR][XR][XD]B19[/XD][XD]=IF(A19<>"",FREQUENCY(IF(A19:A27=A19,ROW(A19:A27)),IF(A19:A27<>A19,ROW(A19:A27))),"")[/XD][/XR][XR][XD]B20[/XD][XD]=IF(A20<>"",FREQUENCY(IF(A20:A28=A20,ROW(A20:A28)),IF(A20:A28<>A20,ROW(A20:A28))),"")[/XD][/XR][XR][XD]B21[/XD][XD]=IF(A21<>"",FREQUENCY(IF(A21:A29=A21,ROW(A21:A29)),IF(A21:A29<>A21,ROW(A21:A29))),"")[/XD][/XR][XR][XD=cs:2][COLOR=red]Press CTRL+SHIFT+ENTER to enter array formulas.[/COLOR][/XD][/XR][/RANGE][B]Entered with Ctrl+Shift+Enter.[/B] If entered correctly, Excel will surround with curly braces {}.
 
Last edited:
Upvote 0
Re-post

Thanks for your response, again. As per the sample below the working formula is in column B the result that I am looking for is in column D. I have tried modifying the formula but can't get the output I am looking for.

Excel Workbook
ABCD
1c41
2c32
3c23
4c14
5d21
6d12
7c21
8c12
9d21
10d12
11c71
12c62
13c53
14c44
15c35
16c26
17c17
18d41
19d32
20d23
21d14
Sheet1
Excel 2010
 
Last edited:
Upvote 0
Re-post

Thanks for your response, again. As per the sample below the working formula is in column B the result that I am looking for is in column D. I have tried modifying the formula but can't get the output I am looking for.

Excel Workbook
ABCD
1c41
2c32
3c23
4c14
5d21
6d12
7c21
8c12
9d21
10d12
11c71
12c62
13c53
14c44
15c35
16c26
17c17
18d41
19d32
20d23
21d14
Sheet1
Excel 2010
Try this...

Enter 1 in cell D1.

Enter this formula in D2 and copy down as needed:

=IF(A2=A1,D1+1,1)
 
Upvote 0
Thanks alot T. Valko. Didn't realise that's all I needed to do. Your help is greatly appreciated.

Cheers.
 
Upvote 0

Forum statistics

Threads
1,224,544
Messages
6,179,430
Members
452,915
Latest member
hannnahheileen

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top