Calculating revenue in excel - excel

Can't calculate the Revenue since the Cell Price contains the 'BDT'.

I find using SUBSTITUTE() to be a pretty clean solution for this. SUBSTITUTE() does a simple find and replace of text in a cell, where applicable. Then VALUE() ensures that the new text is treated as a numeric value rather than a text string.
For example:
=B2*VALUE(SUBSTITUTE(A2,"BDT ",""))
This saves you from having to calculate LENGTH() or spaces in the text with FIND(), etc., so I think it's a little easier to read and implement than other solutions. And it'll work even if "BDT " doesn't appear in the cell, i.e., if there's nothing to replace, then it just... won't replace.
#GPHOfficial's solution will work too, but I find that little less simple to read.
Finally, the "most correct" solution is probably to create a custom currency symbol/format, so you can apply the format in a way that formulas will completely neglect the symbol and only recognize the value.

Try using the formula =RIGHT
I implemented the formula here, the formula should be interchangeable between Excel and Google Sheets
=IFERROR(RIGHT($A7,LEN($A7)-FIND(" ",$A7))*$B7,"")
https://docs.google.com/spreadsheets/d/1PDqQj1y1G56FKzz0Lp86aM-fzso2-IMTZCvZpOoS3go/edit?usp=sharing
(This is based on the assumption that there is a space between the Price and the Currency Code)

Get rid of the BDT.
Use Text to Columns, Delimited, Next, Space, Next, Do not import column (skip), Finish to remove the BDT and leave the prices as true numbers. If you must show the BDT prefix, use a custom number format of \B\D\T General.

Related

how to put avalaible value to designated cell

I'm having some trouble here.
I have an excel test.
The instruction is to adding a final value with an available value, and it should using trim(instruction unclear but it just said "TRIM" on the sheet test.
The data is look like these.
Btw, what is the function in excel to fill the final score but skip the blank(Actually if it with trim)?
Seems pretty easier. MAX() may work for you.
=MAX(C2:D2)
For Microsoft 365 user can use BYROW() for array approach.
=BYROW(C2:D16,LAMBDA(x,MAX(x)))
If you really, really must use Trim(), you might opt for following solution:
=TRIM(A1&B1)
It means that you are using both cells "A1" and "B1" as strings, you concatenate them and trim it, so, in case either one of them contains only space characters, those get chopped off.

Excel: read text as string instead of regex

I'm somewhat new to excel and right now working on a sheet that simply counts the sales numbers of products.
I'm using the formula:
=COUNTIFS('salesreport'!$A$1:$A$1048576,'SalesNumbers'!$A1)
The salesreport sheet contains the data with product names in the A column, the SalesNumbers sheet contains a List of the product names in the A column and the mentioned formula in the second column.
Now to the Problem, some of the products have different variants and a * on the name ending e.g. "Product A*", "Product A large*".
Since the * is interpreted as any following text by Excel, the counter for "Product A*" will include the large variant.
Since I receive the data from outside its difficult to simply get rid of the * for future reports which should just be copy/pasted into the template.
The easy way to solve the problem is obviously to subtract the count of the large variant. The Problem I have with that is, that the formula is no longer consistent for all products and might cause problems if somebody beside me will work on the template.
Is there any way to make Excel read the name in the A column as a string instead of a regex?
Thank you in advance!
Ascani0
If I am understanding this correctly then you can use:
=SUMPRODUCT(--(salesreport!$A:$A=SalesNumbers!$A1))
Edit 2 SUMPRODUCT is powerful and pretty useful ARRAY formula which finds many usages. Here we use it to do specific COUNTIF like stuff.
salesreport!$A:$A=SalesNumbers!$A1 part tests equality
It generates boolean ARRAY of {TRUE,FALSE,TRUE....FALSE}
This result cannot be directly passed on to SUMPRODUCT which expects numeric data. So to achieve numeric coercion, we apply double unary (--) which can be also achieved by using +0 or *1 etc methods.
Edit And if you want to use COUNTIFS then you can use it like below:
=COUNTIFS(salesreport!$A:$A,SUBSTITUTE(SalesNumbers!$A1,"*","~*"))
Here tilde(~) does the work as escape character and allows checking of asterisk (*) in literal sense.

VLookup not returning the results

I'm not sure why my VLOOKUP formula is not working like the screenshot below. The value is right there as highlighted. I want to output the value in Column G, but changing the 3rd parameter to 1 or 2 doesn't work.
Help is appreciated. Thanks much in advance.
Formula: =VLOOKUP(B2,$F$1:$G$421,2,FALSE)
One thing you may want to look at.
I notice your data is left justified and that's normally the case for textual rather than numeric fields - it's possible to left justify numerics but it's neither the default nor the general practice.
If they are textual, there's a chance one or more of them may have leading or trailing spaces. That would prevent the lookup from finding a match.
Select (in turn) B2 and F1 and use the arrow keys in the formula box to check this is not the case.
In cases like this, I tend to (temporarily) set B2 to the formula =F1 just to see if it can find a match that's guaranteed (then use CTRL-Z to revert).
If that change results in the lookup working then obviously the (original) B2 and F1 are not the same value, and you need to work out why (hidden spaces, wrong types, and so on).
It looks like you are comparing text to number (see the green triangle in your value cell). You have to convert the value in your source cell or matching cells to same type. To convert source to number use excel function such as int or value. Hope this helps.
Another way to convert text to number format is to multiply by 1 and then replace original text values with these new number values...
If you are doing lookup where you have a mix of text and numbers (i.e. looking up a text version of a number in a list of real numbers) you can also make use of the VALUE function... this will convert numbers stored as text to real numbers.
Embed it like so:
=VLOOKUP(VALUE(B2),$F$1:$G$421,1,FALSE)
If you have a mix of text numbers and text text to look up in numbers/text then you can do:
=VLOOKUP(IFERROR(VALUE(B2),B2),$F$1:$G$421,1,FALSE)
to change numbers stored as text to numbers, but leave other text as is...

Using SUMIFS with multiple AND OR conditions

I would like to create a succinct Excel formula that SUMS a column based on a set of AND conditions, plus a set of OR conditions.
My Excel table contains the following data and I used defined names for the columns.
Quote_Value (Worksheet!$A:$A) holds an accounting value.
Days_To_Close (Worksheet!$B:$B) contains a formula that results in a number.
Salesman (Worksheet!$C:$C) contains text and is a name.
Quote_Month (Worksheet!$D:$D) contains a formula (=TEXT(Worksheet!$E:$E,"mmm-yy"))to convert a date/time number from another column into a text based month reference.
I want to SUM Quote_Value if Salesman equals JBloggs and Days_To_Close is equal to or less than 90 and Quote_Month is equal to one of the following (Oct-13, Nov-13, or Dec-13).
At the moment, I've got this to work but it includes a lot of repetition, which I don't think I need.
=SUM(SUMIFS(Quote_Value,Salesman,"=JBloggs",Days_To_Close,"<=90",Quote_Month,"=Oct-13")+SUMIFS(Quote_Value,Salesman,"=JBloggs",Days_To_Close,"<=90",Quote_Month,"=Nov-13")+SUMIFS(Quote_Value,Salesman,"=JBloggs",Days_To_Close,"<=90",Quote_Month,"=Dec-13"))
What I'd like to do is something more like the following but I can't work out the correct syntax:
=SUMIFS(Quote_Value,Salesman,"=JBloggs",Days_To_Close,"<=90",Quote_Month,OR(Quote_Month="Oct-13",Quote_Month="Nov-13",Quote_Month="Dec-13"))
That formula doesn't error, it just returns a 0 value. Yet if I manually examine the data, that's not correct. I even tried using TRIM(Quote_Month) to make sure that spaces hadn't crept into the data but the fact that my extended SUM formula works indicates that the data is OK and that it's a syntax issue. Can anybody steer me in the right direction?
You can use SUMIFS like this
=SUM(SUMIFS(Quote_Value,Salesman,"JBloggs",Days_To_Close,"<=90",Quote_Month,{"Oct-13","Nov-13","Dec-13"}))
The SUMIFS function will return an "array" of 3 values (one total each for "Oct-13", "Nov-13" and "Dec-13"), so you need SUM to sum that array and give you the final result.
Be careful with this syntax, you can only have at most two criteria within the formula with "OR" conditions...and if there are two then in one you must separate the criteria with commas, in the other with semi-colons.
If you need more you might use SUMPRODUCT with MATCH, e.g. in your case
=SUMPRODUCT(Quote_Value,(Salesman="JBloggs")*(Days_To_Close<=90)*ISNUMBER(MATCH(Quote_Month,{"Oct-13","Nov-13","Dec-13"},0)))
In that version you can add any number of "OR" criteria using ISNUMBER/MATCH
You can use DSUM, which will be more flexible. Like if you want to change the name of Salesman or the Quote Month, you need not change the formula, but only some criteria cells. Please see the link below for details...Even the criteria can be formula to copied from other sheets
http://office.microsoft.com/en-us/excel-help/dsum-function-HP010342460.aspx?CTT=1
You might consider referencing the actual date/time in the source column for Quote_Month, then you could transform your OR into a couple of ANDs, something like (assuing the date's in something I've chosen to call Quote_Date)
=SUMIFS(Quote_Value,"<=90",Quote_Date,">="&DATE(2013,11,1),Quote_Date,"<="&DATE(2013,12,31),Salesman,"=JBloggs",Days_To_Close)
(I moved the interesting conditions to the front).
This approach works here because that "OR" condition is actually specifying a date range - it might not work in other cases.
Quote_Month (Worksheet!$D:$D) contains a formula (=TEXT(Worksheet!$E:$E,"mmm-yy"))to convert a date/time number from another column into a text based month reference.
You can use OR by adding + in Sumproduct. See this
=SUMPRODUCT((Quote_Value)*(Salesman="JBloggs")*(Days_To_Close<=90)*((Quote_Month="Cond1")+(Quote_Month="Cond2")+(Quote_Month="Cond3")))
ScreenShot
Speed
SUMPRODUCT is faster than SUM arrays, i.e. having {} arrays in the SUM function. SUMIFS is 30% faster than SUMPRODUCT.
{SUM(SUMIFS({}))} vs SUMPRODUCT(SUMIFS({})) both works fine, but SUMPRODUCT feels a bit easier to write without the CTRL-SHIFT-ENTER to create the {}.
Preference
I personally prefer writing SUMPRODUCT(--(ISNUMBER(MATCH(...)))) over SUMPRODUCT(SUMIFS({})) for multiple criteria.
However, if you have a drop-down menu where you want to select specific characteristics or all, SUMPRODUCT(SUMIFS()), is the only way to go. (as for selecting "all", the value should enter in "<>" + "Whatever word you want as long as it's not part of the specific characteristics".
In order to get the formula to work place the cursor inside the formula and press ctr+shift+enter and then it will work!
With the following, it is easy to link the Cell address...
=SUM(SUMIFS(FAGLL03!$I$4:$I$1048576,FAGLL03!$A$4:$A$1048576,">="&INDIRECT("A"&ROW()),FAGLL03!$A$4:$A$1048576,"<="&INDIRECT("B"&ROW()),FAGLL03!$Q$4:$Q$1048576,E$2))
Can use address / substitute / Column functions as required to use Cell addresses in full DYNAMIC.

Why does Excel MATCH() not find a match?

I have a table with some numbers stored as text (UPC codes, so I don't want to lose leading zeros). COUNTIF() recognizes matches just fine, but MATCH() doesn't work. Is there a reason why MATCH() can't handle numbers stored as text, or is this just a limitation I'll have to work around?
Functions like MATCH, VLOOKUP and HLOOKUP need to match data type (number or text) whereas COUNTIF/SUMIF make no distinction. Are you using MATCH to find the position or just to establish whether the value exists in your data?
If you have a numeric lookup value you can convert to text in the formula by using &"", e.g.
=MATCH(A1&"",B:B,0)
....or if it's a text lookup value which needs to match with numbers
=MATCH(A1+0,B:B,0)
If you are looking for the word test for example in cell A2, type the following:
=MATCH(""&"test"&"",A2,0)
If this isn't working then try =Trim and =Clean to purify your column.
If =Trim and =Clean don't help, then just use the left 250 characters...
(As the Match Formula may encounter a timeout/overflow after 250 characters.)
=Left(A2, 250)
If you are using names to refer to the ranges, once you have fixed the datatypes also redefine any names which refer to those ranges.

Resources