Formula to return a certain word if the value in one of the cells in the row occurs elsewhere in the list, but with a different period number

diygail123

New Member
Joined
Oct 24, 2018
Messages
25
Hi

Column B of my spreadsheet contains many occurrences of the period numbers 1 - 12, not always in numerical order.
Column G contains many occurrences of different journal numbers, in the format Jnnn.
I am looking for a formula in cell H1 onwards that returns the word "Reversal" if the Journal number in cell G1 occurs further down column G, but has a period number 1 less than that in cell B1.

For example, Cell B1 contains the period number 4. Cell G1 contains the text J123. If J123 occurs somewhere else in column G, and has a corresponding period number of 3 in column B, I would like a formula in Cell H1 that returns the word "Reversal".

I have a feeling this may need and array formula, and I am not too familiar with these, so any help would be very much appreciated.

Thanks

Gail
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
I am not that good at formulas, but try this and see if it does what you want.
Code:
=IF(OFFSET(INDEX(G2:G$999,MATCH(G1,G2:G$999,0)),0,-5)<$B$1,"Reversal","")
 
Upvote 0
Try this:

varios 10jul2020.xlsm
BGH
14J123Reversal
21j115
31j116
41j117
53j118
63j119
71j120
82j121
92j122
103j123
114j124
124j125
Hoja12
Cell Formulas
RangeFormula
H1H1=IF(COUNTIFS(B2:B12,B1-1,G2:G12,G1),"Reversal","")
 
Upvote 0

Forum statistics

Threads
1,215,626
Messages
6,125,896
Members
449,271
Latest member
bergy32204

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