Formula to return a value based on two cells and on entering data

noreendeasy

New Member
Joined
Jul 16, 2014
Messages
32
Hi there,

I have a spreadsheet that I would like to return 1. Text String based on which cells are entered and 2. Calculated Formula. Both are in different cells and I would like them merged on data is entered.

Its hard to explain but I'll show you what I mean

This starts blank until we get an exception and then we need to figure out whats causing it

A</SPAN>
B</SPAN>
C</SPAN>
1</SPAN>
Movement</SPAN>
Movement Value</SPAN>
BPS</SPAN>
2</SPAN>
Net Gain/Loss </SPAN>
0.16</SPAN>
0.02</SPAN>
3</SPAN>
Income</SPAN>
4</SPAN>
Forward Contracts</SPAN>
0.1</SPAN>
0.01</SPAN>
5</SPAN>
Total</SPAN>
0.03</SPAN>
6</SPAN>
Narrative:</SPAN>
Main Driver of Movement is _____ in this case (A Value) Net Gain/Loss of (C Value) ____ .01 and Forward Contracts of .01 giving an overall movement of _____.03 (C Total)</SPAN>

<TBODY>
</TBODY>
So to explain above what I need is to formula the Narrative:

The user pastes values in B which calculates C.

The Narrative needs to return whats in A and C (as above) based on what the user pastes in B.

So if this changed to:
A</SPAN>
B</SPAN>
C</SPAN>
1</SPAN>
Movement</SPAN>
Movement Value</SPAN>
BPS</SPAN>
2</SPAN>
Net Gain/Loss </SPAN>
3</SPAN>
Income</SPAN>
4</SPAN>
Forward Contracts</SPAN>
0.2</SPAN>
0.03</SPAN>
5</SPAN>
Total</SPAN>
0.03</SPAN>
</SPAN>
</SPAN>

<TBODY>
</TBODY>

The Narrative would need to be automatically updated to using a formula : Is this possible?
6</SPAN>
Narrative:</SPAN>
Main Driver of Movement is Income of .03 giving an overall total of .03
</SPAN>


<TBODY>
</TBODY>


 
Last edited:

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Your example isn't very clear (your first example the numbers don't seem to match your data), however, I *believe* this is what you are looking for.

="Main Driver of Movement is " & IF(C2<>0,CHAR(10) & A2&" of " & C2,"") & IF(COUNT(C2:C3)>1, " and ", "") & IF(C3<>0,CHAR(10) & A3&" of " & C3,"") & IF(COUNT(C2:C4)>1," and ", "")& IF(C4<>0,CHAR(10) & A4&" of " & C4,"") & " " & CHAR(10) & "giving an overall movement of " & C5

NOTE: the Char(10) characters will insert line breaks and need Wrap Text turned on. If you do not want line breaks, use this formula...

="Main Driver of Movement is " & IF(C2<>0, A2&" of " & C2,"") & IF(COUNT(C2:C3)>1, " and ", "") & IF(C3<>0, A3&" of " & C3,"") & IF(COUNT(C2:C4)>1," and ", "")& IF(C4<>0,A4&" of " & C4,"") & " " & "giving an overall movement of " & C5
 
Upvote 0
Can you explain this and maybe I could understand it and edit it myself? Or else what is it you don't understand from my data? The BPS column isn't meant to add up its just an example....

Possibly this is better explained:

A</SPAN>
B</SPAN>
C</SPAN>
1</SPAN>
Movement</SPAN>
Movement Value</SPAN>
BPS</SPAN>
2</SPAN>
Net Gain/Loss </SPAN>
this column is a formula based on columns Bs data
3 </SPAN>
Income</SPAN>
=0.2*Nav*10000
4</SPAN>
Forward Contracts</SPAN>
0.2</SPAN>
0.03</SPAN>
5</SPAN>
Total</SPAN>
0.03</SPAN>
</SPAN>
</SPAN>

<TBODY>
</TBODY>
Thanks, Noreen
 
Last edited:
Upvote 0
In your first example, you have 0.02 in the data for Net Gain/Loss but use 0.01 in the narrative.
In the second example, you have nothing for Income, but list 0.03 which is shown as the data for Forward Contracts.

Basically, what my formula does is check if the value in column C <> 0 and if so it lists the column header from A and the value from C. The countif determines whether the word AND should be used. If you have more specific questions or if it is not working as required, please let me know.
 
Upvote 0
Hi Sorry I mixed it up,

You're completely spot on about what I need to do, it just doesn't seem to work.

I will use my real data it might explain it actually easier:

Can you help create the formula for this please?

Prior Day NAV</SPAN>
14.26309</SPAN>
Movement</SPAN>Movements</SPAN>BPS
PERIOD INCOME</SPAN> 0.00</SPAN>
PERIOD AMORT/ACCRET</SPAN> 0.00</SPAN>
PERIOD INFLATION COMPENSATION</SPAN> 0.00</SPAN>
PERIOD EXPENSES </SPAN> 0.00</SPAN>
INCOME DISTRIBUTIONS</SPAN> 0.00</SPAN>
EXCHANGE GAIN/LOSS RECLASSED AS INCOME</SPAN>-0.00724</SPAN>-0.05</SPAN>
PERIOD REALIZED GAIN/LOSS </SPAN> 0.00</SPAN>
GAIN/LOSS EFFECT OF TRANSACTIONS </SPAN> 0.00</SPAN>
NET GAIN/LOSS EFFECT </SPAN>-0.04953</SPAN> -0.35</SPAN>
GAIN/LOSS DISTRIBUTIONS</SPAN> 0.00</SPAN>
CAPITAL SHARE ACTIVITY</SPAN> 0.00</SPAN>
SUBSCRIPTIONS</SPAN> 0.00</SPAN>
REDEMPTIONS</SPAN> 0.00</SPAN>
NET OF CAPITAL SHARE ACTIVITY</SPAN> 0.00</SPAN>
PRELIMINARY NET ASSETS</SPAN> 0.00</SPAN>
EFFECT OF PRICE CHANGES ON HOLDINGS</SPAN> 0.00</SPAN>
ADJUSTMENT FOR AMORT/ACCRET</SPAN> 0.00</SPAN>
RECEIVABLES/PAYABLE</SPAN> 0.00</SPAN>
INCOME</SPAN> 0.00</SPAN>
CCT FORWARD CONTRACTS</SPAN> 0.00</SPAN>
CCT SPOT CONTRACTS</SPAN> 0.00</SPAN>
ADJUSTMENT FOR GLOBAL FUTURES</SPAN>0.14463</SPAN> 1.01</SPAN>
OTHER MISCELLANEOUS ADJUSTMENTS</SPAN> 0.00</SPAN>
Total 0.62
</SPAN>

<TBODY>
</TBODY><COLGROUP><COL><COL><COL></COLGROUP>
 
Upvote 0
Thank you, the actual data makes more sense and I see why my formula doesn't work well (there are simply too many rows for my current method)
Are these always the options listed or are the items in the Movement list variable? That is, always X number of rows with the Total in the same place?
 
Upvote 0
Thank you, the actual data makes more sense and I see why my formula doesn't work well (there are simply too many rows for my current method)
Are these always the options listed or are the items in the Movement list variable? That is, always X number of rows with the Total in the same place?

Yes these are the only options and the total is always in the same place, it comes from a report.
 
Upvote 0
Are you open to using a VBA solution? I don't think a native Excel formula is going to be sufficient in this case.
 
Upvote 0
Yes VBA is ok, I have basic / ok understanding of it - use it often for Macros! Cna you help, I wouldn't know how to use it in this instance? Thanking you kindly
 
Upvote 0

Forum statistics

Threads
1,213,556
Messages
6,114,284
Members
448,562
Latest member
Flashbond

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