[Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register]

Author Message
worrierqueen
Newbie

Joined: 14 May 2012
Posts: 3

 Posted: Mon May 14, 2012 6:03 pm    Post subject: nested if statements [solved] I have a query about nested if statements and would appreciate any help. I'm trying to do up order totals and have two columns quantities and values. The values come in two currencies which I need to convert to local currency. So my first if statment says if there is a number in the quantity column then put the \$value in the \$Value column, but the \$value placed there should be the local currency if the currency column is the local currency or instead should be modified by the exchange rate (a constant in the exchange rate conversion cell) to convert into the local currency if the order was placed in the foreign currency. e.g. if I'm selling a widget for 10 pounds or \$20 and 1 widget has been sold then put \$20 in the \$value column if the value is in \$ or put the pound value x by the exchange rate in the \$value column instead. Thus all the \$value totals end up in the local currency. Hope this makes sense and thanks again for any help.Last edited by worrierqueen on Mon May 14, 2012 10:06 pm; edited 1 time in total
worrierqueen
Newbie

Joined: 14 May 2012
Posts: 3

 Posted: Mon May 14, 2012 6:25 pm    Post subject: nested if statements To be absolutely clear why i can't just use one if statement, we sell widgets and wodgets and I'm also trying to find out how many widgets we sell and how many wodgets we sell. So say column A is product name, column B is no. of products sold, column C is value and column D is currency. I am trying to derive 4 more values; column E being widget sales, column F being widget \$value, Column G being wodget sales and column H being wodget \$value. My current formula says in column E1 =IF(A1="widget";A2;0) in column F1 it says =IF(E1<>0;C1;0) similarly column G and H are the same except for wodget's rather than widgets. The problem is that both column F and H don't take currency into account, so i need to add a nested loop somewhere to say If Column D is non-local currency then instead of putting C1 in F1 I need to put C1 x exchange rate (a single-value constant) into F1. Hope that is clearer and thanks again for any help.
ozzie

Joined: 29 Jul 2010
Posts: 316
Location: victoria

Posted: Mon May 14, 2012 9:54 pm    Post subject:

Perhaps something like this
 Code: IF(AND(A3="widget";D3<>0);C3*\$M\$4;IF(AND(A3="widget";D3="");C3;""))

But I have to admit that I'm really confused by the conversion rate cell (in my fomula it's M4) as your explanation seems to suggest that there is only one foreign exchange rate used, which never changes on a day to day basis!?
_________________
worrierqueen
Newbie

Joined: 14 May 2012
Posts: 3

 Posted: Mon May 14, 2012 10:00 pm    Post subject: Thanks very much for this ozzie, appreciate it. Since its looking at historic data (over years) I'm just using annual average exchange rate data for each year's sales. Thanks again.
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First
 All times are GMT - 8 Hours Page 1 of 1

 Jump to: Select a forum OpenOffice.org Forums----------------Setup and TroubleshootingOpenOffice.org WriterOpenOffice.org CalcOpenOffice.org ImpressOpenOffice.org DrawOpenOffice.org MathOpenOffice.org BaseOpenOffice.org Macros and APIOpenOffice.org Code Snippets Community Forums----------------General DiscussionSite Feedback
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum