Excel database - formula multiplication exchange rate by date - excel

I am creating some accounting papers and I need multiplicate USD exchange rate with our currency by date. I tried everything, but I don't know how to do it..
Here is example:
DATE | USD | CZK
1.1.2018 | 2$ | USD Price * CZK Price by same date
2.2.2018 | 2$ | USD Price * CZK Price by same date
EXCHANGE RATE
1.1.2018 | 22
2.2.2018 | 23
(It means that price on 1.1 will be 44CZK and 2.2 will be 46CZK)
And this I need do for every day in year.
So hand writing isn't possible. I need some formula for it.
Can you help me please? I know that it can be by vlookup and If..
Thanks!

You can use INDEX with MATCH to achieve this as well and wrap in IFERROR in case a match for the "date" string is not found in the lookup column. If a match is found in the lookup column E, for the "date" string in column A the number returned for the match is passed as a row number argument for Index on column F which returns to rate in the same row as the match was found. This is then multiplied by column B.
You would alter the ranges $F$2:$F$3 and $E$2:$E$3 to encompass all your actual rows in those columns.
In B2 and drag down
=IFERROR(B2*INDEX($F$2:$F$3,MATCH(A2,$E$2:$E$3,0)),"")

Yes, you can muliply with the exchange rate in your cell while doing the lookup at the same time, so in Cell C2:
=B2*(VLOOKUP(A2,$E$2:$F$3,2,FALSE))
I.e. VLOOKUP(A2,$E$2:$F$3,2,FALSE) will give you the exchange rate,
A2: Lookup value, the date in our case.
$E$2:$F$3: Where we can find the date in your "search area". Notice that the date we search for, needs to be in the first column of our "search area".
2: In our "search area", from which column number should we return our return number/value. In our case our "search area" is two column, where we want the result to be return from the 2nd column of column E and F.
FALSE: Search for exact match.
When the exchange rate is found we mulptiply it with the dollar amount, i.e. B2 * Vlookup() :)

Related

Number occurrences in another cell (Excell) [duplicate]

I have simple problem, but I've not be able to get an answer from searching. I require a column to calculate the number of the nth occurrence of a value. It's best explained in this picture
I require a method to calculate column B.
I'd be very grateful for any help.
Are you looking to merely provide a count of the distinct entries of column A in column B? Or merely add a formula to come up with the table in your link?
If the latter, then the formula to write in cell B2 is:
=COUNTIF(A$2:A2,A2)
then copy/paste it down column B. Note - if your data is both a Date and Time, but the cell is formatted to only display a date, you may not get the results you want. You'd need to interject a new column with a "floor" calculation to round the date/time value to a date (Excel date times are decimal, with integer part dictating the date, and remaining 0.0 -> 1.0 dictating the time of day)
If you just want to derive a table of the counts of distinct entries in column A, then a pivot table will do this for you - simple add a pivot table to cover the data in column A, then select column A into the rows category, and then also drag it into the values category, ensuring the field is set to "Count of". You should then have a table with the distinct entries in your data set in one column, and the count of their occurrences in the other column.
You can use the COUNTIF worksheet function, with a relative address.
Eg. In cell B2, enter this formula:
=COUNTIF(A$2:A2,A2)
And then fill-down.
Use the following formula to generate the required series:
=COUNTIF($A$1:A1,A1) and strech(copy) it in all the cells
This will generate result like this:
A 1 COUNTIF($A$1:A1,A1)
A 2 COUNTIF($A$1:A2,A2)
C 1 COUNTIF($A$1:A3,A3)
C 2 COUNTIF($A$1:A4,A4)
B 1 COUNTIF($A$1:A5,A5)
B 2 COUNTIF($A$1:A6,A6)
A 3 COUNTIF($A$1:A7,A7)
C 3 COUNTIF($A$1:A8,A8)
D 1 COUNTIF($A$1:A9,A9)
D 2 COUNTIF($A$1:A10,A10)
D 3 COUNTIF($A$1:A11,A11)
D 4 COUNTIF($A$1:A12,A12)

Dynamic currency conversion based on symbol + lookup [excel]

Example illustrated below, but I essentially have 3 columns:
Column A is 3-letter currency abbreviation (total 4 types).
Column B is an amount.
Column C is a 2-letter country code (total 2 types).
What I need is for column D to apply a custom conversion to the column B amount, with output in the currency of column C and based on the conversion rate of column A.
To illustrate:
Row 1: Both currency and country are same = no change to value.
Row 2: Both currency and country are same = no change to value.
Row 3: Currency is JPY, country is UK = B4 amount * JPY to GBP rate.
Row 4: Currency is EUR, country is US = B5 amount * EUR to USD rate.
So, basically an if statement to check what the code is in column A, then apply a custom multiplier based on column C.
I don't suppose anyone can think of an elegant way to do this?
It depends on how you have your conversion values. If you have them in a table like in the below snapshot, then you can use INDEX/MATCH like this:
=INDEX($H$2:$K$5,MATCH(A2,$G$2:$G$5,0),MATCH(C2,$H$1:$K$1,0))*B2
Conversely if you have something more like the following snapshot, then using SUMIFS would be easier:
=SUMIFS(I:I,G:G,A2,H:H,C2)*B2

Calculate Occurrence Number - Excel

I have simple problem, but I've not be able to get an answer from searching. I require a column to calculate the number of the nth occurrence of a value. It's best explained in this picture
I require a method to calculate column B.
I'd be very grateful for any help.
Are you looking to merely provide a count of the distinct entries of column A in column B? Or merely add a formula to come up with the table in your link?
If the latter, then the formula to write in cell B2 is:
=COUNTIF(A$2:A2,A2)
then copy/paste it down column B. Note - if your data is both a Date and Time, but the cell is formatted to only display a date, you may not get the results you want. You'd need to interject a new column with a "floor" calculation to round the date/time value to a date (Excel date times are decimal, with integer part dictating the date, and remaining 0.0 -> 1.0 dictating the time of day)
If you just want to derive a table of the counts of distinct entries in column A, then a pivot table will do this for you - simple add a pivot table to cover the data in column A, then select column A into the rows category, and then also drag it into the values category, ensuring the field is set to "Count of". You should then have a table with the distinct entries in your data set in one column, and the count of their occurrences in the other column.
You can use the COUNTIF worksheet function, with a relative address.
Eg. In cell B2, enter this formula:
=COUNTIF(A$2:A2,A2)
And then fill-down.
Use the following formula to generate the required series:
=COUNTIF($A$1:A1,A1) and strech(copy) it in all the cells
This will generate result like this:
A 1 COUNTIF($A$1:A1,A1)
A 2 COUNTIF($A$1:A2,A2)
C 1 COUNTIF($A$1:A3,A3)
C 2 COUNTIF($A$1:A4,A4)
B 1 COUNTIF($A$1:A5,A5)
B 2 COUNTIF($A$1:A6,A6)
A 3 COUNTIF($A$1:A7,A7)
C 3 COUNTIF($A$1:A8,A8)
D 1 COUNTIF($A$1:A9,A9)
D 2 COUNTIF($A$1:A10,A10)
D 3 COUNTIF($A$1:A11,A11)
D 4 COUNTIF($A$1:A12,A12)

Using Max function result in SumIFS Excel

I have a table like the image given above. There is another sheet which reports some information based on this data. I need the sum of Apples in the last week for a given month.
The answer for apples for 8 th month would be 14 assuming there is another record as Apples - 32 - 10 - 8.
So I would have to find max week number for a given month and then sum the quantity for Apples with max week number
The formula written is
=SUMIFS( C2:C300, A2:A300, H16, B2:B300, MAX(IF(D2:D300=MONTH(TODAY()-1),B2:B300)))
H16 contains the word "Apples"
Column A - Item
Column B - Week
Column C - Quantity
Column D - Month
Column H - Unique Items again..
MAX(IF(D2:D300=MONTH(TODAY()-1),B2:B300)) returns the correct max as 32 for month 8 but the formula returns the value as 0. If I put the max formula in aseperate cell and refer that cell in main formula, it works as expected. I am not sure why the result of max value is not being used for sumif function.
Your formula is good. all you need to do is to convert it into Array Formula. Just type the formula with Ctr + shift + enter.
{=SUMIFS( C2:C300, A2:A300, H16, B2:B300, MAX(IF(D2:D300=MONTH(TODAY()-1),B2:B300)))}
Actually, without array, the part IF(D2:D300 evaluates to #value error as Excel doesn't not know how to compare an array against one value.
Hint: Not sureif you know it already, but anyways, always use Formulas --> Evaluate Formula to pin-point an error in a formula.

Excel - Sum of values based on a drop down defining whether they are negative or positive

I've tried searching for posts specifically on this, but am struggling to find what I'm looking for. I'm trying to do some fairly basic calculations based on a value in a drop down field for each row which determines whether the value is negative or positive.
In the example below, I would like to sum all the values in Column B based on a drop down value (Column C) which defines whether the value in column be should be added or subtracted from the total amount in C10.
I'll be honest, I have no idea how to even begin working out how to write the formula for the Credit/Debit values based on the drop down.
A B C D
1 DATE VALUE TYPE DESCRIPTION
---- ----- ---- -----------
2 02/03/2015 £150 Debit Currency Exchange
3 20/04/2015 £200 Debit Currency Exchange
4 04/05/2015 £1000 Credit Currency Exchange
5
6
7
8
9
10 TOTAL ADJUSTMENTS: £650
I'm guessing I need to somehow use the SUMIF statement to define whether the type in Column C is Debit or Credit and then add/substract the corresponding value some how from the total amount?
Many thanks in advance for any assistance you may be able to offer.
Try
=SUMIF(C2:C9,"Credit",B2:B9)-SUMIF(C2:C9,"Debit",B2:B9)
The first Sumif sums up all the credits, the second Sumif sums up all the debits and the debit sum is then subtracted from the credit sum.

Resources