LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Junior Member
 
Posts: 5
Question Formula in VBA

Hello ALL,

i have uploaded sample file at http://www.box.com/s/tvkcb2daxzj1g2zzaxa0

I intend to write present code written in formula to be written in VBA, can any one help me with that.

I have formula in column (named Result) N6 onwards and (Remarks) O6 onwards. is there any way that instead of writting formula in cell i could get same result by writing code in VBA, so that if some one removes any row result does not get wrongly referenced.

The condition for results are,
1. Candidate should Qualify "Q" in Height bar (G)
2. Candidate should Qualify "Q" in Run (H)
3. Height :- if candidate is "ST" then min height to qualify is 162.5 cm and
for others min height is 170 cm (I)
4. Chest :- if candidate is "ST" then min chest is 76 cm and for others it is
80 cm. (J)
5. Expansion :- Min expansion required is 5 cm i.e. (J - I)

6. if columns G to M are empty then it is assumed candidate is absent "A".
7. If an ST candidate qualifies then remarks column has "Subject to Cert."
all this is being achived with the formula in column N & O.

Thanx in advance
formula used in result column (N)

Code:
Code:
=IF(AND(G6=0,H6=0,I6=0,J6=0,K6=0),"A",IF(H6="NQ","NQ",IF(I6="NQ","NQ",IF(AND(G6="ST",J6<162.5),"NQ", IF(AND(G6<"ST",J6<170),"NQ",IF(AND(G6="ST",K6<76),"NQ",IF(AND(G6<"ST",K6<80),"NQ",IF(AND(G6="ST",L 6-K6<5),"NQ",IF(AND(G6<"ST",L6-K6<5),"NQ","Q")))))))))
& formula used in remarks column (O)
Code:
Code:
=IF(N6="A","",IF(H6="NQ","Height Bar",IF(I6="NQ","Run",IF(AND(G6="ST",J6<162.5),"Less Height",IF(AND(G6=" ",H6=" ",I6=" ",J6=" ",K6=" ")," ",IF(AND(G6<"ST",J6<170),"Less Height",IF(AND(G6="ST",K6<76),"Less Chest",IF(AND(G6<"ST",K6<80),"Less Chest",IF(AND(G6="ST",L6-K6<5),"Less Chest Expansion",IF(AND(G6<"ST",L6-K6<5),"Less Chest Expansion",IF(AND(G6="ST",N6="Q"),"Subject to Cert."," ")))))))))))
I have posted this on http://www.mrexcel.com/forum/showthread.php?t=618066.


regards

aJIT :-)
Attached Files
File Type: zip Jeff reply.zip (50.9 KB, 28 views)

Last edited by ajitexcel : March 4th 12 at 11:36 AM Reason: Attaching ref file.
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Regression Leverage Formula (Jerry W. Lewis or Mike Middleton)already have DFITS formula PJ[_3_] Excel Worksheet Functions 2 June 2nd 10 03:45 PM
Excel 2002 Formula: Urgent Conditional Formula Required Right Away - if possible blue[_2_] Excel Discussion (Misc queries) 2 July 11th 07 06:08 PM
Build excel formula using field values as text in the formula val kilbane Excel Worksheet Functions 2 April 18th 07 01:52 PM
Formula expected end of statement error, typing formula into cell as part of VBA macro [email protected] Excel Programming 1 July 20th 06 07:58 PM
Commenting custom formula fields/formula on formula editor Muxer Excel Programming 2 July 24th 03 01:02 AM


All times are GMT +1. The time now is 03:05 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"