Excel formula - sumifs - excel-formula

I have been digging into various websites but could not find out how to solve my formula.
=SUMIFS(Laundry!AH10:AH1006;Laundry!AE10:AE1006;"22 mar";Laundry!AG10:AG1006;"8")
I have a several tabs - each tab for a different day. In this case, my condition is "22 mar". When I copy my formula to a different tab - such as day "23 mar", I would like to have the condition changed accordingly - switch from "22 mar" into "23 mar" or whatever number it happens to be.
Basically I would like to copy the formula - and the condition would be changed according to what day I will input into a certain cell.
Do you have any idea, how to resolve this?
Thank you in advance.

You can use this rather complex beast to get the tab name of the current worksheet:
=MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255)
Applying this in your formula:
=SUMIFS(Laundry!AH10:AH1006;Laundry!AE10:AE1006; MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,255);Laundry!AG10:AG1006;"8")

Related

Excel apply a formula to same cell

It could be a basic one, trying to apply formula =TEXT(A2/(24*60*60),"dd \d\a\y\s hh:mm:ss") on the same column Seconds to a new computed value. For eg., 495079 tranform to 05 days 17:31:19. I don't want to bring in additional columns. Any help is appreciated.
Duplicate: this answer.
#MADHU VS - your formula is exactly like the one in that answer. Maybe what's confusing you is you think the answer should be 5 days - it's really 4. "04 days 17:31:19"
The person who answered on the other thread also made a useful suggestion not to use the text function. Use =A2/(24*60*60) on your sheet, then go into the time formatting dialog and set up a custom format dd \d\a\y\s hh:mm:ss.
I just tried that, and it works perfectly. I was able to subtract 1 from it in a different cell, and got "03 days 17:31:19" (if that would be useful to you).
24*60*60 = 86400.
Enter =86400 in a cell. Copy that cell. Just select the range of the "Second" numbers only (not the entire column) and right click then select Copy paste special, select divide (Also select values if so desired), click OK. No need for another column.
Then format cells pressing Control + 1

Indirect Function with Sheet Names

I have a list of all of the sheet names in my workbook on Sheet1 and I am trying, without success, to use the INDIRECT function to reference a cell on another sheet using said name. I am aware that this is a common question, I have looked at about 10 other questions/answers on this website in addition to others. For some reason, those solutions are not working and I am kinda losing my mind.
The sheet names are all in column A
They are named after dates (format mm-dd-yy) <- I'm assuming this is the problem?
The cell that I am trying to reference is always in O1 on every sheet in the workbook.
I have tried:
=INDIRECT(A1&"!O1")
=INDIRECT("'"A1"'&!O1")
and a few other amalgamations. Again, I have looked into so many other solutions at this point I am just left with asking for help with my situation, which is apparently unique (or more likely it is some blaring user error). Please help me before immediately removing the post.
If I have this right, the names of your sheets are dates, and you have the names listed as dates in Column A. So, they will appear as dates, but are actually Excel's background number for a date (days since 1/1/1900).
If you use the Formulas tab in the ribbon to Evaluate Formula, you should see the date pop in to your formula as a 5 digit number.
If you are not doing anything else with these dates, you could try selecting column A and formatting as text. This solved the issue in my test setup. This will still work if you are using the date for other functions, but you will have to tell Excel it's a date using DateValue()
After formatting Column A as text, I used =INDIRECT("'"&A1&"'!O1")
Try,
=indirect(text(a1, "\'mm-dd-yy\'\!\O\1"))

Custom formatting in Excel

I have the following problem in excel.
Lets say I have 10 cells in my spread sheet that contains the following;
Cash per 30.06.17
I want to use the Concatenate-formula (or other if that solves my problem) in order to be able to use a referance cell to change the date going forward in all 10 cells.
=concatenate("Cash per";"referance cell that contains the date)
However, when doing this I receive the following;
Cash per 42916.
Can somebody help me with this problem? The way I see it I need a special input to the custom category in cells formatting.
Thank you.
Andreas
You have to add the "TEXT"-function to your formula to format the date:
=CONCATENATE("Cash per";TEXT([Reference cell with date];"dd.mm.yyyy"))

How to outline the range of several columns and tabs in 3D formula?

After a lot of searching I succeed making a formula with a reference to another tab (March) > =SUMIF(maart!$Z7:$Z47,"410200",maart!$W7:$W47) ... :)
Nevertheless I need some help ...
1) How to adjust the formula (as concise as possible) to search for multiple columns? So not only $W7:$W47 but also $X7:$X47 and $Y7:$Y47 in the same month.
2) How to adjust the formula to search on multiple tabs? From januari!:december!
Thanks in advance!
[edit]
I know now how to put 2 (12) months into a formula:
=SUMIF(maart!$Z7:$Z47,"410200",maart!$W7:$W47)+SUMIF(april!$Z7:$Z47,"410200",april!$W7:$W47)
... but it is surely possible to shorten such a long string, isn't it?
For multiple sheets have a look at my answer here
....but for multiple columns I think you would have to repeat the formula (criteria and sum ranges are always the same size in SUMIF)
If you want to generate "sheetlist" automatically in the formula then for all 12 months you can use an expression like
=TEXT({1,2,3,4,5,6,7,8,9,10,11,12}*29,"MMMM")
You might have to change "MMMM" depending on your regional settings

Excel - Sum column if condition is met by checking other column in same table

I am trying to create spreadsheet to use in a small retail shop.
I have a workbook which contains expenses figures on a sheet and income figure on another sheet.
We can say that the common ground between the both sheets are the month.
I would like to write a function, which will only select those expenses of a specified month.
Something like -
=SUM(IF( Table4[Month]="January", Table4[Amount]))
// I want the sum of all expenses of a given table for only
// those months which are january etc.
I tried using the above, but it failed.
Actually a more refined solution is use the build-in function sumif, this function does exactly what you need, will only sum those expenses of a specified month.
example
=SUMIF(A2:A100,"=January",B2:B100)
This should work, but there is a little trick. After you enter the formula, you need to hold down Ctrl+Shift while you press Enter. When you do, you'll see that the formula bar has curly-braces around your formula. This is called an array formula.
For example, if the Months are in cells A2:A100 and the amounts are in cells B2:B100, your formula would look like {=SUM(If(A2:A100="January",B2:B100))}. You don't actually type the curly-braces though.
You could also do something like =SUM((A2:A100="January")*B2:B100). You'd still need to use the trick to get it to work correctly.
SUMIF didn't worked for me, had to use SUMIFS.
=SUMIFS(TableAmount,TableMonth,"January")
TableAmount is the table to sum the values, TableMonth the table where we search the condition and January, of course, the condition to meet.
Hope this can help someone!

Resources