Help me expand my formula please :(

Jyggalag

Active Member
Joined
Mar 8, 2021
Messages
445
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Hi all,

I have this formula:
1721745565173.png


Formula: =IF(J4=""; IF(I4>P4; "G4 grant bigger than Total grant (IA) by " & TEXT(ROUND(I4-P4; 2); "0.00") & " DKK"; ""); IF(J4>P4; "G5 grant bigger than Total grant (IA) by " & TEXT(ROUND(J4-P4; 2); "0.00") & " DKK"; ""))

I want to expand it, so that it looks my TPC in column H (cell H4) if cell I4 is blank, in G4 is cell H4 is blank and in cell F4 if G4 is blank. I want it to make the same calculation and say for example if H4 > P4, "G3 grant bigger than Total grant (IA) by " & TEXT(ROUND(H4-P4; 2);"0.00") & "DKK";"").

I tried to expand the formula myself, and I have been able to do it for J4 and I4, but it keeps bugging now and telling me that I am missing a parenthesis or something, and even when I add it, it just repeats the same error over and over.

I have tried for an hour now, but am unable to make the formula function. Do we have any hidden excel geniuses here that may be able to either edit it or give me a better formula? Would be much appreciated!!! :)
 
Then all my messages should be ignored/deleted
Not at all. Based on all the examples posted up until recently, your approach was perfectly valid. :) Also, it may well help someone else in future who does want the maximum value regardless of where it is.
 
Upvote 0

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
Since you have 365:

Excel Formula:
=LET(mpos;MATCH(1E100;F4:J4);
mval;INDEX(F4:J4;mpos);
IF(mval>P4;
RIGHT(INDEX(F3:J3;mpos);2) & " grant is bigger than total grant (IA) by " & mval-P4 & " DKK";
""))
This formula works, thank you so much Rory! You are a godsend

If I may have one final request, is there a way to edit the formula, so the number it shows has 0 decimals?

At the moment is shows around 6 decimals:

1721993225358.png
 
Upvote 0
Yes:

Excel Formula:
=LET(mpos;MATCH(1E100;F4:J4);
mval;INDEX(F4:J4;mpos);
IF(mval>P4;
RIGHT(INDEX(F3:J3;mpos);2) & " grant is bigger than total grant (IA) by " & ROUND(mval-P4;0) & " DKK";
""))

If you want to add other formatting, you'll need to use the TEXT function and whatever your regional formatting codes are.
 
Upvote 0
Solution
Yes:

Excel Formula:
=LET(mpos;MATCH(1E100;F4:J4);
mval;INDEX(F4:J4;mpos);
IF(mval>P4;
RIGHT(INDEX(F3:J3;mpos);2) & " grant is bigger than total grant (IA) by " & ROUND(mval-P4;0) & " DKK";
""))

If you want to add other formatting, you'll need to use the TEXT function and whatever your regional formatting codes are.
Amazing, this worked!!!

Thank you so much RoryA! You are a lifesaver :)

also @saboh12617 your input is much appreciated! :)

Here's my full formula for reference (I added text and iferror to it:

=IFERROR(LET(mpos;MATCH(1E+100;F4:J4);
mval;INDEX(F4:J4;mpos);
IF(mval>P4;
RIGHT(INDEX($F$3:$J$3;mpos);2) & " grant is bigger than total grant (IA) by " & TEXT(ROUND(mval-P4;0);"#.##0") & " DKK";
""));"")
 
Upvote 0

Forum statistics

Threads
1,223,884
Messages
6,175,174
Members
452,615
Latest member
bogeys2birdies

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