OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

nested if statements [solved]

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc
View previous topic :: View next topic  
Author Message
worrierqueen
Newbie
Newbie


Joined: 14 May 2012
Posts: 3

PostPosted: Mon May 14, 2012 6:03 pm    Post subject: nested if statements [solved] Reply with quote

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
Back to top
View user's profile Send private message
worrierqueen
Newbie
Newbie


Joined: 14 May 2012
Posts: 3

PostPosted: Mon May 14, 2012 6:25 pm    Post subject: nested if statements Reply with quote

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.
Back to top
View user's profile Send private message
ozzie
OOo Advocate
OOo Advocate


Joined: 29 Jul 2010
Posts: 400
Location: victoria

PostPosted: Mon May 14, 2012 9:54 pm    Post subject: Reply with quote

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!?
_________________
If your problem has been solved please add "[Solved]" to the beginning of your first post title (edit button).
Back to top
View user's profile Send private message
worrierqueen
Newbie
Newbie


Joined: 14 May 2012
Posts: 3

PostPosted: Mon May 14, 2012 10:00 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group