避免在Excel中循环引用

时间:2019-03-08 15:23:09

标签: excel excel-formula formula

我想计算包括风险在内的价格。问题是我想避免循环引用。有什么方法可以避免启用“迭代计算”?

基本上我需要在B9中计算价格,它是import { TestBed, ComponentFixture, async } from '@angular/core/testing'; import { ProcessoService } from './processo.service'; import { PontuaAppConfig } from 'frontend-base'; import { AbstractCRUDService, BlockUiService, UtilsService } from 'serpro-web-base'; import { HttpClient } from '@angular/common/http'; import { ProcessoModule } from './processo.module'; class PontuaAppConfigStub { baseApiUrl = ''; } describe('Serviço Processo', () => { let sut: ProcessoService; let pontuaAppConfig: PontuaAppConfig; let fixture: ComponentFixture<ProcessoService>; beforeEach(done => (async () => { TestBed.configureTestingModule({ providers: [ { provide: HttpClient, useClass: HttpClient, deps: [] }, { provide: PontuaAppConfig, useClass: PontuaAppConfigStub }, { provide: AbstractCRUDService, useClass: ProcessoService }, ProcessoService, BlockUiService, UtilsService, ], imports: [ProcessoModule], declarations: [] }); pontuaAppConfig = TestBed.get(PontuaAppConfig); fixture = TestBed.createComponent(ProcessoService); sut = fixture.debugElement.injector.get(ProcessoService); await TestBed.compileComponents(); })().then(done).catch(done.fail)); it('should be created', () => { console.log(sut); expect(sut).toBeTruthy(); }); it('should Get apiUrl', () => { spyOn(pontuaAppConfig, 'baseApiUrl'); sut.getApiUrl(); expect(pontuaAppConfig.baseApiUrl).toMatch(''); }); it('should set local store for processos', () => { spyOn(sut, 'listarCache').and.returnValue({subscribe: () => {}}); fixture.detectChanges(); expect(sut.listarCache()).toHaveBeenCalled(); expect(window.localStorage.getItem('processos')).not.toBeNull(); }); });

其中B4为=(B1+B4)/(1-B7)

enter image description here

启用了迭代计算的结果”:

enter image description here

1 个答案:

答案 0 :(得分:2)

无论您使用哪种经济方法来计算风险(我不是经济学家),都没有SolverVBA的帮助,唯一的方法就是构造迭代表。表越扩展,解决方案就越精确...

Iterations table

只是地方:

在单元格D5上:=($A2+D4)/(1-$A6)

在单元格E4上:=$A4*D5

并将公式水平拖动到表格的末尾。