qtr formula

sachin483

Board Regular
Joined
Mar 31, 2015
Messages
163
Office Version
  1. 2019
Platform
  1. Windows
if all 4 qtr is >= 100 then 20000 , if any 3 qtr > 100 and anl > 105 ach% , then 20000 after matching col1 and col2 with the grid

[TABLE="width: 341"]
<tbody>[TR]
[TD]grid[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]col1[/TD]
[TD]AA[/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]ANL[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]XX[/TD]
[TD]25000[/TD]
[TD]20000[/TD]
[TD]16500[/TD]
[TD]13000[/TD]
[TD]105[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]YY[/TD]
[TD]20000[/TD]
[TD]17000[/TD]
[TD]14500[/TD]
[TD]12000[/TD]
[TD]110[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]data[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]col1[/TD]
[TD]col2[/TD]
[TD]QTR1[/TD]
[TD]QTR2[/TD]
[TD]QTR3[/TD]
[TD]QTR4[/TD]
[TD]ANL[/TD]
[TD]Amount[/TD]
[/TR]
[TR]
[TD]XX[/TD]
[TD]A[/TD]
[TD]84[/TD]
[TD]124[/TD]
[TD]111[/TD]
[TD]108[/TD]
[TD]106[/TD]
[TD]20000[/TD]
[/TR]
[TR]
[TD]XX[/TD]
[TD]A[/TD]
[TD]108[/TD]
[TD]101[/TD]
[TD]113[/TD]
[TD]109[/TD]
[TD]108[/TD]
[TD]20000[/TD]
[/TR]
[TR]
[TD]XX[/TD]
[TD]A[/TD]
[TD]104[/TD]
[TD]112[/TD]
[TD]103[/TD]
[TD]109[/TD]
[TD]107[/TD]
[TD]20000[/TD]
[/TR]
[TR]
[TD]XX[/TD]
[TD]A[/TD]
[TD]104[/TD]
[TD]105[/TD]
[TD]109[/TD]
[TD]85[/TD]
[TD]101[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]XX[/TD]
[TD]AA[/TD]
[TD]93[/TD]
[TD]133[/TD]
[TD]110[/TD]
[TD]110[/TD]
[TD]111[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]XX[/TD]
[TD]AA[/TD]
[TD]100[/TD]
[TD]122[/TD]
[TD]112[/TD]
[TD]94[/TD]
[TD]107[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]XX[/TD]
[TD]B[/TD]
[TD]68[/TD]
[TD]133[/TD]
[TD]114[/TD]
[TD]115[/TD]
[TD]107[/TD]
[TD]16500[/TD]
[/TR]
[TR]
[TD]XX[/TD]
[TD]B[/TD]
[TD]101[/TD]
[TD]114[/TD]
[TD]108[/TD]
[TD]105[/TD]
[TD]107[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]XX[/TD]
[TD]C[/TD]
[TD]103[/TD]
[TD]117[/TD]
[TD]118[/TD]
[TD]105[/TD]
[TD]111[/TD]
[TD]13000[/TD]
[/TR]
[TR]
[TD]XX[/TD]
[TD]C[/TD]
[TD]85[/TD]
[TD]119[/TD]
[TD]115[/TD]
[TD]112[/TD]
[TD]108[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]YY[/TD]
[TD]A[/TD]
[TD]85[/TD]
[TD]125[/TD]
[TD]112[/TD]
[TD]109[/TD]
[TD]108[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]YY[/TD]
[TD]A[/TD]
[TD]109[/TD]
[TD]102[/TD]
[TD]114[/TD]
[TD]110[/TD]
[TD]109[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]YY[/TD]
[TD]A[/TD]
[TD]105[/TD]
[TD]113[/TD]
[TD]104[/TD]
[TD]110[/TD]
[TD]108[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]YY[/TD]
[TD]A[/TD]
[TD]100[/TD]
[TD]119[/TD]
[TD]127[/TD]
[TD]86[/TD]
[TD]108[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]YY[/TD]
[TD]AA[/TD]
[TD]94[/TD]
[TD]134[/TD]
[TD]111[/TD]
[TD]111[/TD]
[TD]113[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]YY[/TD]
[TD]AA[/TD]
[TD]101[/TD]
[TD]123[/TD]
[TD]113[/TD]
[TD]95[/TD]
[TD]108[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]YY[/TD]
[TD]B[/TD]
[TD]69[/TD]
[TD]134[/TD]
[TD]115[/TD]
[TD]116[/TD]
[TD]109[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]YY[/TD]
[TD]B[/TD]
[TD]102[/TD]
[TD]115[/TD]
[TD]109[/TD]
[TD]106[/TD]
[TD]108[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]YY[/TD]
[TD]C[/TD]
[TD]104[/TD]
[TD]118[/TD]
[TD]119[/TD]
[TD]106[/TD]
[TD]112[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]YY[/TD]
[TD]C[/TD]
[TD]86[/TD]
[TD]120[/TD]
[TD]116[/TD]
[TD]113[/TD]
[TD]109[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Not entirely sure that I've understood your request but see if this is what you need..

Excel Workbook
ABCDEFGHIJKLMNO
1col1col2QTR1QTR2QTR3QTR4ANLAmountcol1AAABCANL
2XXA84124111108106,&quot;&gt;=100&quot;)=4,20000,IF(AND(COUNTIF(Table1:],&quot;&gt;=100&quot;)=3,&gt;105),INDEX(Table2,MATCH(,Table2,0),MATCH(,Table2,0)),0))]20000XX25000200001650013000105
3XXA108101113109108,&quot;&gt;=100&quot;)=4,20000,IF(AND(COUNTIF(Table1:],&quot;&gt;=100&quot;)=3,&gt;105),INDEX(Table2,MATCH(,Table2,0),MATCH(,Table2,0)),0))]20000YY20000170001450012000110
4XXA104112103109107,&quot;&gt;=100&quot;)=4,20000,IF(AND(COUNTIF(Table1:],&quot;&gt;=100&quot;)=3,&gt;105),INDEX(Table2,MATCH(,Table2,0),MATCH(,Table2,0)),0))]20000
5XXA10410510985101,&quot;&gt;=100&quot;)=4,20000,IF(AND(COUNTIF(Table1:],&quot;&gt;=100&quot;)=3,&gt;105),INDEX(Table2,MATCH(,Table2,0),MATCH(,Table2,0)),0))]0
6XXAA93133110110111,&quot;&gt;=100&quot;)=4,20000,IF(AND(COUNTIF(Table1:],&quot;&gt;=100&quot;)=3,&gt;105),INDEX(Table2,MATCH(,Table2,0),MATCH(,Table2,0)),0))]25000
7XXAA10012211294107,&quot;&gt;=100&quot;)=4,20000,IF(AND(COUNTIF(Table1:],&quot;&gt;=100&quot;)=3,&gt;105),INDEX(Table2,MATCH(,Table2,0),MATCH(,Table2,0)),0))]25000
8XXB68133114115107,&quot;&gt;=100&quot;)=4,20000,IF(AND(COUNTIF(Table1:],&quot;&gt;=100&quot;)=3,&gt;105),INDEX(Table2,MATCH(,Table2,0),MATCH(,Table2,0)),0))]16500
9XXB101114108105107,&quot;&gt;=100&quot;)=4,20000,IF(AND(COUNTIF(Table1:],&quot;&gt;=100&quot;)=3,&gt;105),INDEX(Table2,MATCH(,Table2,0),MATCH(,Table2,0)),0))]20000
10XXC103117118105111,&quot;&gt;=100&quot;)=4,20000,IF(AND(COUNTIF(Table1:],&quot;&gt;=100&quot;)=3,&gt;105),INDEX(Table2,MATCH(,Table2,0),MATCH(,Table2,0)),0))]20000
11XXC85119115112108,&quot;&gt;=100&quot;)=4,20000,IF(AND(COUNTIF(Table1:],&quot;&gt;=100&quot;)=3,&gt;105),INDEX(Table2,MATCH(,Table2,0),MATCH(,Table2,0)),0))]13000
12YYA85125112109108,&quot;&gt;=100&quot;)=4,20000,IF(AND(COUNTIF(Table1:],&quot;&gt;=100&quot;)=3,&gt;105),INDEX(Table2,MATCH(,Table2,0),MATCH(,Table2,0)),0))]17000
13YYA109102114110109,&quot;&gt;=100&quot;)=4,20000,IF(AND(COUNTIF(Table1:],&quot;&gt;=100&quot;)=3,&gt;105),INDEX(Table2,MATCH(,Table2,0),MATCH(,Table2,0)),0))]20000
14YYA105113104110108,&quot;&gt;=100&quot;)=4,20000,IF(AND(COUNTIF(Table1:],&quot;&gt;=100&quot;)=3,&gt;105),INDEX(Table2,MATCH(,Table2,0),MATCH(,Table2,0)),0))]20000
15YYA10011912786108,&quot;&gt;=100&quot;)=4,20000,IF(AND(COUNTIF(Table1:],&quot;&gt;=100&quot;)=3,&gt;105),INDEX(Table2,MATCH(,Table2,0),MATCH(,Table2,0)),0))]17000
16YYAA94134111111113,&quot;&gt;=100&quot;)=4,20000,IF(AND(COUNTIF(Table1:],&quot;&gt;=100&quot;)=3,&gt;105),INDEX(Table2,MATCH(,Table2,0),MATCH(,Table2,0)),0))]20000
17YYAA10112311395108,&quot;&gt;=100&quot;)=4,20000,IF(AND(COUNTIF(Table1:],&quot;&gt;=100&quot;)=3,&gt;105),INDEX(Table2,MATCH(,Table2,0),MATCH(,Table2,0)),0))]20000
18YYB69134115116109,&quot;&gt;=100&quot;)=4,20000,IF(AND(COUNTIF(Table1:],&quot;&gt;=100&quot;)=3,&gt;105),INDEX(Table2,MATCH(,Table2,0),MATCH(,Table2,0)),0))]14500
19YYB102115109106108,&quot;&gt;=100&quot;)=4,20000,IF(AND(COUNTIF(Table1:],&quot;&gt;=100&quot;)=3,&gt;105),INDEX(Table2,MATCH(,Table2,0),MATCH(,Table2,0)),0))]20000
20YYC104118119106112,&quot;&gt;=100&quot;)=4,20000,IF(AND(COUNTIF(Table1:],&quot;&gt;=100&quot;)=3,&gt;105),INDEX(Table2,MATCH(,Table2,0),MATCH(,Table2,0)),0))]20000
21YYC86120116113109,&quot;&gt;=100&quot;)=4,20000,IF(AND(COUNTIF(Table1:],&quot;&gt;=100&quot;)=3,&gt;105),INDEX(Table2,MATCH(,Table2,0),MATCH(,Table2,0)),0))]12000
Sheet2
 
Upvote 0
[TABLE="width: 512"]
<tbody>[TR]
[TD="class: xl65, width: 64"]grid[/TD]
[TD="class: xl65, width: 64"][/TD]
[TD="class: xl65, width: 64"][/TD]
[TD="class: xl65, width: 64"][/TD]
[TD="class: xl65, width: 64"][/TD]
[TD="class: xl65, width: 64"][/TD]
[TD="class: xl65, width: 64"][/TD]
[TD="class: xl65, width: 64"][/TD]
[/TR]
[TR]
[TD="class: xl63"]col1[/TD]
[TD="class: xl66"]AA[/TD]
[TD="class: xl66"]A[/TD]
[TD="class: xl66"]B[/TD]
[TD="class: xl66"]C[/TD]
[TD="class: xl63"]ANL[/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65"][/TD]
[/TR]
[TR]
[TD="class: xl68"]XX[/TD]
[TD="class: xl63"]25000[/TD]
[TD="class: xl63"]20000[/TD]
[TD="class: xl63"]16500[/TD]
[TD="class: xl63"]13000[/TD]
[TD="class: xl63"]105[/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65"][/TD]
[/TR]
[TR]
[TD="class: xl65"][/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65"][/TD]
[/TR]
[TR]
[TD="class: xl65"][/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65"][/TD]
[/TR]
[TR]
[TD="class: xl65"]data[/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65"][/TD]
[TD="class: xl65"][/TD]
[/TR]
[TR]
[TD="class: xl63"]col1[/TD]
[TD="class: xl64"]col2[/TD]
[TD="class: xl64"]QTR1[/TD]
[TD="class: xl64"]QTR2[/TD]
[TD="class: xl64"]QTR3[/TD]
[TD="class: xl64"]QTR4[/TD]
[TD="class: xl64"]ANL[/TD]
[TD="class: xl64"]amount[/TD]
[/TR]
[TR]
[TD="class: xl68"]XX[/TD]
[TD="class: xl67"]A[/TD]
[TD="class: xl64"]84[/TD]
[TD="class: xl69"]124[/TD]
[TD="class: xl69"]111[/TD]
[TD="class: xl69"]108[/TD]
[TD="class: xl69"]106[/TD]
[TD="class: xl65"][/TD]
[/TR]
</tbody>[/TABLE]

i want to first compare col1 of data with the grid of col1 then data col2 with transpose (AA,A,B,C) of grid and then check that all the qtr are >=100 of data , if 100 then the amount as per transpose slab(AA,A,B,C) and then any 3 qtr >= 100 of data and anl of data greater than anl of grid then the amount from transpose slab id (AA,A,B,C)

the formula i have tried but reflecting error at table1 as i given name range to table1 to data and table2 to grid
 
Upvote 0
Like this?
Excel Workbook
ABCDEFGHIJKLMNO
1col1col2QTR1QTR2QTR3QTR4ANLAmountcol1AAABCANL
2XXA84124111108106,&quot;&gt;100&quot;)=4,AND(COUNTIF(Table1:],&quot;&gt;100&quot;)=3,&gt;=INDEX(Table2,MATCH(,Table2,0)))),INDEX(Table2,MATCH(,Table2,0),MATCH(,Table2,0)),&quot;&quot;)]20000XX25000200001650013000105
3XXA108101113109108,&quot;&gt;100&quot;)=4,AND(COUNTIF(Table1:],&quot;&gt;100&quot;)=3,&gt;=INDEX(Table2,MATCH(,Table2,0)))),INDEX(Table2,MATCH(,Table2,0),MATCH(,Table2,0)),&quot;&quot;)]20000YY20000170001450012000110
4XXA104112103109107,&quot;&gt;100&quot;)=4,AND(COUNTIF(Table1:],&quot;&gt;100&quot;)=3,&gt;=INDEX(Table2,MATCH(,Table2,0)))),INDEX(Table2,MATCH(,Table2,0),MATCH(,Table2,0)),&quot;&quot;)]20000
5XXA10410510985101,&quot;&gt;100&quot;)=4,AND(COUNTIF(Table1:],&quot;&gt;100&quot;)=3,&gt;=INDEX(Table2,MATCH(,Table2,0)))),INDEX(Table2,MATCH(,Table2,0),MATCH(,Table2,0)),&quot;&quot;)]
6XXAA93133110110111,&quot;&gt;100&quot;)=4,AND(COUNTIF(Table1:],&quot;&gt;100&quot;)=3,&gt;=INDEX(Table2,MATCH(,Table2,0)))),INDEX(Table2,MATCH(,Table2,0),MATCH(,Table2,0)),&quot;&quot;)]25000
7XXAA10012211294107,&quot;&gt;100&quot;)=4,AND(COUNTIF(Table1:],&quot;&gt;100&quot;)=3,&gt;=INDEX(Table2,MATCH(,Table2,0)))),INDEX(Table2,MATCH(,Table2,0),MATCH(,Table2,0)),&quot;&quot;)]
8XXB68133114115107,&quot;&gt;100&quot;)=4,AND(COUNTIF(Table1:],&quot;&gt;100&quot;)=3,&gt;=INDEX(Table2,MATCH(,Table2,0)))),INDEX(Table2,MATCH(,Table2,0),MATCH(,Table2,0)),&quot;&quot;)]16500
9XXB101114108105107,&quot;&gt;100&quot;)=4,AND(COUNTIF(Table1:],&quot;&gt;100&quot;)=3,&gt;=INDEX(Table2,MATCH(,Table2,0)))),INDEX(Table2,MATCH(,Table2,0),MATCH(,Table2,0)),&quot;&quot;)]16500
10XXC103117118105111,&quot;&gt;100&quot;)=4,AND(COUNTIF(Table1:],&quot;&gt;100&quot;)=3,&gt;=INDEX(Table2,MATCH(,Table2,0)))),INDEX(Table2,MATCH(,Table2,0),MATCH(,Table2,0)),&quot;&quot;)]13000
11XXC85119115112108,&quot;&gt;100&quot;)=4,AND(COUNTIF(Table1:],&quot;&gt;100&quot;)=3,&gt;=INDEX(Table2,MATCH(,Table2,0)))),INDEX(Table2,MATCH(,Table2,0),MATCH(,Table2,0)),&quot;&quot;)]13000
12YYA85125112109108,&quot;&gt;100&quot;)=4,AND(COUNTIF(Table1:],&quot;&gt;100&quot;)=3,&gt;=INDEX(Table2,MATCH(,Table2,0)))),INDEX(Table2,MATCH(,Table2,0),MATCH(,Table2,0)),&quot;&quot;)]
13YYA109102114110109,&quot;&gt;100&quot;)=4,AND(COUNTIF(Table1:],&quot;&gt;100&quot;)=3,&gt;=INDEX(Table2,MATCH(,Table2,0)))),INDEX(Table2,MATCH(,Table2,0),MATCH(,Table2,0)),&quot;&quot;)]17000
14YYA105113104110108,&quot;&gt;100&quot;)=4,AND(COUNTIF(Table1:],&quot;&gt;100&quot;)=3,&gt;=INDEX(Table2,MATCH(,Table2,0)))),INDEX(Table2,MATCH(,Table2,0),MATCH(,Table2,0)),&quot;&quot;)]17000
15YYA10011912786108,&quot;&gt;100&quot;)=4,AND(COUNTIF(Table1:],&quot;&gt;100&quot;)=3,&gt;=INDEX(Table2,MATCH(,Table2,0)))),INDEX(Table2,MATCH(,Table2,0),MATCH(,Table2,0)),&quot;&quot;)]
16YYAA94134111111113,&quot;&gt;100&quot;)=4,AND(COUNTIF(Table1:],&quot;&gt;100&quot;)=3,&gt;=INDEX(Table2,MATCH(,Table2,0)))),INDEX(Table2,MATCH(,Table2,0),MATCH(,Table2,0)),&quot;&quot;)]20000
17YYAA10112311395108,&quot;&gt;100&quot;)=4,AND(COUNTIF(Table1:],&quot;&gt;100&quot;)=3,&gt;=INDEX(Table2,MATCH(,Table2,0)))),INDEX(Table2,MATCH(,Table2,0),MATCH(,Table2,0)),&quot;&quot;)]
18YYB69134115116109,&quot;&gt;100&quot;)=4,AND(COUNTIF(Table1:],&quot;&gt;100&quot;)=3,&gt;=INDEX(Table2,MATCH(,Table2,0)))),INDEX(Table2,MATCH(,Table2,0),MATCH(,Table2,0)),&quot;&quot;)]
19YYB102115109106108,&quot;&gt;100&quot;)=4,AND(COUNTIF(Table1:],&quot;&gt;100&quot;)=3,&gt;=INDEX(Table2,MATCH(,Table2,0)))),INDEX(Table2,MATCH(,Table2,0),MATCH(,Table2,0)),&quot;&quot;)]14500
20YYC104118119106112,&quot;&gt;100&quot;)=4,AND(COUNTIF(Table1:],&quot;&gt;100&quot;)=3,&gt;=INDEX(Table2,MATCH(,Table2,0)))),INDEX(Table2,MATCH(,Table2,0),MATCH(,Table2,0)),&quot;&quot;)]12000
21YYC86120116113109,&quot;&gt;100&quot;)=4,AND(COUNTIF(Table1:],&quot;&gt;100&quot;)=3,&gt;=INDEX(Table2,MATCH(,Table2,0)))),INDEX(Table2,MATCH(,Table2,0),MATCH(,Table2,0)),&quot;&quot;)]
Sheet2
 
Upvote 0
i am using excel 2010 & 2007 error message reflecting while entering the formula at -- Table1[@[QTR1]
 
Upvote 0
@njimack
Neil, not sure if you are aware that you can use the ‘Analyse range (Forum)’ field near the top left of the Excel jeanie screen to restrict the number of formulas generated. Click or click & drag if there is a single contiguous region of formulas you want to display. If non-contiguous cells, just type the cell addresses with commas between.

There is generally no need to display multiple formulas that are basically the same, it just fills up the board and makes your post and the thread hard to read/navigate.
 
Last edited:
Upvote 0
thanks a lot @njimack now working fine i was not inserting the table through insert command but giving the range name from the left corner both are different can you explained a little bit how its work
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,175
Members
453,021
Latest member
Justyna P

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