How to pick and assign formula on behalf of cell color

pankajgrover

Board Regular
Joined
Oct 27, 2022
Messages
99
Office Version
  1. 365
Platform
  1. Windows
Hi, i am doing copy paste formula according to buy sell option. But i want if cell have green color this Formula =(((F22-L22)*B22)*C22)-AI22+O22-N22 apply or if have red color this Formula =(((F21-L21)*B21)*C21)-H21+AI21 apply in same Net result column. Still now i doing manually and How i do that automatic? I want in below example AI column auto pick formula from cell AG16, AG17 color based .Should i do any conditional formatting ? Thanks

Shares Trading (1).xlsx
ACADAEAFAGAI
15Net result
16Oil6621.0023/12/20220.56500.00-6050
17Gas430.0023/12/20221410.0025500
sheet
Cell Formulas
RangeFormula
AI16AI16=(((F16-L16)*B16)*C16)-H16+AH16
AI17AI17=(((F17-L17)*B17)*C17)-AH17+O17-N17
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
I think that is what I would be doing.


You're welcome. .. and thanks.
Dear sir, i am doing 1 more some complex calculation . In below example AK3 i want actual result 15770. Actually i am trying to do use if formula but i am unable to do. In example my formula works if G4 or M6 have no values, but issue arise when G3 or M3 have some both values . So how to make formula to solve this in single AK Result Column, may be if or function hv to used ? here is example :

Shares Trading (1)33.xlsx
ABCFGHLMNOAHAIAJAKAL
2NameUnitsLPQtyPriceAmountS.QtyS.PriceBrok.S.AmountQtyPriceAmountRESULTRESULT SHOULD BE in AK Col.
3Silver30.0069033.00169191.002075730169750.001000.002091500169750.002091500-100015770 FOR (((F3-L3)*B3)*C3)-H3+AJ3
4Silver30.0069033.00 164972.501949175168000.002040000-30990-30990
5Silver30.0069033.00 0.564845.009726750.568000.001020000-15495-15495
6Natural Gas1250.00430.401433.00541250 1410.005125002550025500
kk
Cell Formulas
RangeFormula
B3:B6B3=IFERROR(VLOOKUP(A3,Prices!$A$2:$C$25,2,0),0)
C3:C6C3=IFERROR(VLOOKUP(A3,Prices!$A$2:$C$25,3,0),0)
H3:H6H3=((F3*B3)*G3)
O3:O6O3=((L3*B3)*M3)-(N3)
AJ3:AJ6AJ3=((AH3*B3)*AI3)-(N3)
AK3:AK6AK3=(F3-L3)*B3*C3+IF(G3="",-H3+AJ3,-AJ3+O3-N3)
Named Ranges
NameRefers ToCells
Shares=OFFSET(Prices!$A$2,0,0,COUNTA(Prices!$A$2:$A$25))B3:C6
Cells with Data Validation
CellAllowCriteria
A3:A6List=Shares
 
Upvote 0
Is this directly related to the previous question? Doesn't seem to be anything to do with B/S or red/green?
Unless you can explain this is closely related to the previous question I suggest that you start a new thread for the new question.
 
Upvote 0
Is this directly related to the previous question? Doesn't seem to be anything to do with B/S or red/green?
Unless you can explain this is closely related to the previous question I suggest that you start a new thread for the new question.
Ok i will post this to new thread. Thanks
 
Upvote 0

Forum statistics

Threads
1,214,619
Messages
6,120,550
Members
448,970
Latest member
kennimack

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