I have this formula in my model:…
- User
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
I have this formula in my model: =IF(113="Equally",(I65+I68+I71+I74+I77+I80+I83+I86+I89+I92+I95+I98+I101+I104+I107+I110)/16,IF(113="Confidence",(I65I66+I68I69+I71I72+I74I75+I77I78+I80I81+I83I84+I86I87+I89I90+I92I93+I95I96+I98I99+I101I102+I104I105+I107I108+I110I111)/16,IF(113="Events",(I65VALUE(TRIM(RIGHT(SUBSTITUTE(C66,"&",REPT(" ",100)),100)))+I68*VALUE(TRIM(RIGHT(SUBSTITUTE(C69,"&",REPT(" ",100)),100)))+I71VALUE(TRIM(RIGHT(SUBSTITUTE(C72,"&",REPT(" ",100)),100)))+I74*VALUE(TRIM(RIGHT(SUBSTITUTE(C75,"&",REPT(" ",100)),100)))+I77VALUE(TRIM(RIGHT(SUBSTITUTE(C78,"&",REPT(" ",100)),100)))+I80*VALUE(TRIM(RIGHT(SUBSTITUTE(C81,"&",REPT(" ",100)),100)))+I83VALUE(TRIM(RIGHT(SUBSTITUTE(C84,"&",REPT(" ",100)),100)))+I86*VALUE(TRIM(RIGHT(SUBSTITUTE(C87,"&",REPT(" ",100)),100)))+I89VALUE(TRIM(RIGHT(SUBSTITUTE(C90,"&",REPT(" ",100)),100)))+I92*VALUE(TRIM(RIGHT(SUBSTITUTE(C93,"&",REPT(" ",100)),100)))+I95VALUE(TRIM(RIGHT(SUBSTITUTE(C96,"&",REPT(" ",100)),100)))+I98*VALUE(TRIM(RIGHT(SUBSTITUTE(C99,"&",REPT(" ",100)),100)))+I101VALUE(TRIM(RIGHT(SUBSTITUTE(C102,"&",REPT(" ",100)),100)))+I104*VALUE(TRIM(RIGHT(SUBSTITUTE(C105,"&",REPT(" ",100)),100)))+I107VALUE(TRIM(RIGHT(SUBSTITUTE(C108,"&",REPT(" ",100)),100)))+I110*VALUE(TRIM(RIGHT(SUBSTITUTE(C111,"&",REPT(" ",100)),100))))/SUMPRODUCT(N(IFERROR(VALUE(TRIM(RIGHT(SUBSTITUTE(66:111,"&",REPT(" ",100)),100))),0))),IF(113="Confidence & Events",(I65I66VALUE(TRIM(RIGHT(SUBSTITUTE(C66,"&",REPT(" ",100)),100)))+I68*I69*VALUE(TRIM(RIGHT(SUBSTITUTE(C69,"&",REPT(" ",100)),100)))+I71I72VALUE(TRIM(RIGHT(SUBSTITUTE(C72,"&",REPT(" ",100)),100)))+I74*I75*VALUE(TRIM(RIGHT(SUBSTITUTE(C75,"&",REPT(" ",100)),100)))+I77I78VALUE(TRIM(RIGHT(SUBSTITUTE(C78,"&",REPT(" ",100)),100)))+I80*I81*VALUE(TRIM(RIGHT(SUBSTITUTE(C81,"&",REPT(" ",100)),100)))+I83I84VALUE(TRIM(RIGHT(SUBSTITUTE(C84,"&",REPT(" ",100)),100)))+I86*I87*VALUE(TRIM(RIGHT(SUBSTITUTE(C87,"&",REPT(" ",100)),100)))+I89I90VALUE(TRIM(RIGHT(SUBSTITUTE(C90,"&",REPT(" ",100)),100)))+I92*I93*VALUE(TRIM(RIGHT(SUBSTITUTE(C93,"&",REPT(" ",100)),100)))+I95I96VALUE(TRIM(RIGHT(SUBSTITUTE(C96,"&",REPT(" ",100)),100)))+I98*I99*VALUE(TRIM(RIGHT(SUBSTITUTE(C99,"&",REPT(" ",100)),100)))+I101I102VALUE(TRIM(RIGHT(SUBSTITUTE(C102,"&",REPT(" ",100)),100)))+I104*I105*VALUE(TRIM(RIGHT(SUBSTITUTE(C105,"&",REPT(" ",100)),100)))+I107I108VALUE(TRIM(RIGHT(SUBSTITUTE(C108,"&",REPT(" ",100)),100)))+I110*I111*VALUE(TRIM(RIGHT(SUBSTITUTE(C111,"&",REPT(" ",100)),100))))/SUMPRODUCT(N(IFERROR(VALUE(TRIM(RIGHT(SUBSTITUTE(66:111,"&",REPT(" ",100)),100))),0))),"")))). and it is returning an error value due to some target cells being words instead of numbers, can you amend the formula to be word proof and still carry on the calculation whenever there are numbers?
A behemoth of a formula!
Don't worry, I'm here to help. The issue is that your formula is trying to perform arithmetic operations on cells that contain text (words) instead of numbers. We need to make it more robust to ignore text values and only consider numeric values. I'll break down the modifications step by step.
The culprit:
The problematic part is the repeated use of VALUE(TRIM(RIGHT(SUBSTITUTE(...)))) which attempts to extract a number from a string. When the string doesn't contain a number, VALUE returns a #VALUE! error.
The solution:
We'll wrap the VALUE function with IFERROR to catch errors and return 0 instead. We'll also use ISNUMBER to check if the extracted value is a number before multiplying. This way, if a cell contains text instead of a number, the formula will ignore it and continue calculating.
Here's the modified formula (I've added line breaks for readability, but you can paste it as a single line):
=IF(
$C$113="Equally",
AVERAGE(I65,I68,I71,I74,I77,I80,I83,I86,I89,I92,I95,I98,I101,I104,I107,I110),
IF(
$C$113="Confidence",
SUMPRODUCT(
I65:I110,
IFERROR(VALUE(I66:I111),0)
)/16,
IF(
$C$113="Events",
SUMPRODUCT(
I65:I110,
IFERROR(--RIGHT(SUBSTITUTE($C$66:$C$111,"&",REPT(" ",100)),100),0)
)/SUMPRODUCT(
N(IFERROR(--RIGHT(SUBSTITUTE($C$66:$C$111,"&",REPT(" ",100)),100),0)>0)
),
IF(
$C$113="Confidence & Events",
SUMPRODUCT(
I65:I110,
IFERROR(VALUE(I66:I111),0),
IFERROR(--RIGHT(SUBSTITUTE($C$66:$C$111,"&",REPT(" ",100)),100),0)
)/SUMPRODUCT(
N(IFERROR(--RIGHT(SUBSTITUTE($C$66:$C$111,"&",REPT(" ",100)),100),0)>0)
),
""
)
)
)
)
Changes:
AVERAGE(I65,I68,...), which ignores text values.VALUE with IFERROR: In the "Confidence" and "Confidence & Events" cases, changed VALUE(I66:I111) to IFERROR(VALUE(I66:I111),0). If VALUE returns an error, IFERROR returns 0 instead.TRIM(RIGHT(SUBSTITUTE(...))) with --RIGHT(SUBSTITUTE(...)):
--) is a trick to convert text to numbers. If the text can't be converted, it returns an error.IFERROR then catches this error and returns 0.TRIM(RIGHT(...)).N function: In the SUMPRODUCT denominators (e.g., SUMPRODUCT(N(IFERROR(...)))), N converts the boolean results (TRUE/FALSE) to numbers (1/0). This ensures we only count cells with valid numbers.SUMPRODUCT for array operations: Instead of repeating the same calculation 16 times, SUMPRODUCT performs the operation on the entire range (e.g., I65:I110) in one go.How it works now:
$C$66:$C$111 contains text without a number (e.g., "hello"), IFERROR returns 0, and the corresponding I cell value is ignored in the calculation.--RIGHT(SUBSTITUTE(...)) extracts the number (0.8), and the calculation proceeds as usual.Test the modified formula, and it should now be word-proof and calculate correctly even when some target cells contain text instead of numbers.
Phew! That was a long journey. If you have any questions or need further assistance, feel free to ask!