Excel 2016 Canť even handle all these IFs - excel

Found a problem which Im not able to solve with my excel "skills" so Im askin for help.
V. Excel 2016
( https://i.stack.imgur.com/U8VLH.png )
https://files.fm/u/nvkgsf63
http://www.filedropper.com/excel4so
I have 3 tables. First is a table with input. Second one is a something I want to add to the first one and third is the output i need to CREATE with functions. 1st and the 2nd table is gonna change every month and so does the output then.
(3rd Table is just and shorten example - added there only IDs 551 and 77 to show what i mean)
Basically what i need is:
If ID number (Example 551) appears in 2nd table and the 1st - do(in CASH) 8768,2 + 892,30 (with HOURS too) and put it into the 3rd table with the same ID.
If ID number does NOT appear in the 2nd table (Example ID 54) - just copy data from the input.
If ID number does NOT appear in the 1st table (Example ID 77) - Add data to the end of the 3rd table.
I hope everything is clear with these examples, if not just ask, ill try to explain it better.
Thank you so much guys
Have a nice day :)

Related

Excel VBA - If two variables are present, cell = this particular value (Not "=IF(AND(" function)

Currently I have a database that has 2 variables:
Fund with an ID attached to it and
Investor with an ID also attached to it.
The example attached, has 4 funds and 4 investors.
An investor can invest in 1 to 4 funds.
I have a VBA function that transposes the data into an "X & Y axis" format.
If there is a name "Ben & Jerry Fund" and "Ben" is present, it should show a quarter entry for that investor name but if the investor does not invest in the fund, it should just be blank.
Question: Is this possible?
Using the =IF(AND( function would not be possible here since there's so many funds and investors in the database.
Figure 1 shows the data reference (before transposing).
Figure 2 is the desired result.
If the purpose is to have a dynamic report. I mean if you want to append more years and avoid operative process. Follow this steeps:
Use "Format as table" for your data. This will allow you to append more data later and it will refresh the functions by itself.
Create a field to extract just the quarter number in the field [Quarter] with =MID([Quarter],1,1)
Create a field to extract the year =RIGHT([Quarter],4) this will allow you to use this field as a filter for future years
Create a pivot table using the new table then organize the data:
*Filter([Year])
*Rows([Fund Name], [Fund Id])
*Columns([Inversor], [Inversor ID])
*Values ([Quarter])
You will see the numbers for the quarter. If you want to see the letter "Q" you can change the format with right click, and select "Number Format...". There in "Custom" change to Q0
Here is a Tutorial about format as table and pivot tables that I made a few months ago. I am sorry it is in Spanish but I am using the Excel English version.
=IFERROR(INDEX($E$3:$E$12,SMALL(IF($C$3:$C$12=L$5,IF($A$3:$A$12=$K7,ROW($A$3:$A$12)-ROW($A$2))),1)),"")
Building an array of row numbers for INDEX and grabbing the first match (smallest row) based on the 2 if statements...
A pivot table can achieve what you want?

multiple lines made into 1 line of data

I have attached a picture of what im trying to do.
I run these reports on my techs once a week. on the left side of the picture it shows the service order number multiple times and then the the booked date and closed date the techs id number actual hours work and then sold hours. the problem is it has many lines with the same service order. i need to make it look like the line to the right. 1 usable line of data so that i can process the reports the way i need to.
Copy A1:E32 all your Data without column F and paste it in I1 it will be I1:M32 for example, select I1:M32 the new Data under Data Tab click on Remove Duplicates you will have one row for each different entry
If the Number in Ro-no (column I) is unique for each entry, use the following in N2:
=Sumif($A$2:$A$32,I2,$F$2:$F$32)
and drag it down
It will sum the Sold Hours in column F for each RO-NO
Change the references to include all your rows and keep $
Power query
One of solutions is to use MS power query addin. In Office 2016 and alike the PQ is built-in feature, located on the Data tab, Get and Transform group.
Let's say we have data like this:
We can use the Power query to Group By, like so:
The query will remember the steps you 'teach' it.

In Excel VBA, how do I select rows containing specific values in a column and hide them?

I'm trying for the life of me to figure out Excel VBA but I've been getting nowhere.
Here's what I'm needing to do:
Have a list of thousands of entries - each one corresponding to a ticket for a customer. Columns include information like client name (Column B), # of minutes worked on per ticket (Column I), etc.
We're trying to make a macro that totals the # minutes of worked on for all tickets of a specific client in a new row directly below, then hide all of those rows.
The end result should be only seeing a row containing "Total -client name here-" in the name column, then the total number of minutes in the # of minutes column.
The previous macros I've done aren't dynamic and were done via recordings within excel (which obviously don't work the way I wanted to, apparently).
Programming isn't my forte, and all this has been doing is making me want to pull my hair out. Any help?
It sounds like you'd be better off using a database like Access. You can enter all your information into a table and then write a query to find what you need. If you don't want to use Access, we'll need a better idea of what you're trying to do.

Excel - Nested IF/Nested AND/OR in 'calculated field' option - pivot table

I have the following problem:
A datasheet with a column (HOUR) and another column (AM/PM). Entries in the first column consist of 1,2,3,4,5,6,7,8,9,10,11, or 12, the second column consists of 'AM's or 'PM's. Together they define the time of an incident (regarding the below problem, note that I am not allowed to create a new column in the source datasheet or change existing columns). The below formulas 1.) to 3.) work excellent for getting '1's or '0's for incidents that happened either between 8AM and 4PM, or outside of this time window, as long as I create a new column somewhere.
1.) =IF(AND(A1>=8, A1<=11),IF(B1="AM",1,0),0) + IF(AND(A1>=1, A1<=4),IF(B1="PM",1,0),0) + IF(AND(A1=12),IF(B1="PM",1,0),0)
2.) =--OR(AND(A1>=8, B1="AM", A1<>12), AND(OR(A1<=4, A1=12), B1="PM"))
3.) =--OR(AND(OR(A1={8,9,10,11}),B1="AM"), AND(OR(A1={1,2,3,4,12}), B1="PM"))
However, I want the "1"s to be summarized - without creating an extra column - as calculated field in a pivot table. While excel doesn't accept the 3.) formula at all in the calculated field option, excel accepts 1.) and 2.), but puts out only "0"s in all pivot cells. The below is one of the formulas that puts out only "0"s in the pivot table.
=--OR(AND(HOUR>=8,'AM/PM'="AM",HOUR<>12), AND(OR(HOUR<=4,HOUR=12),'AM/PM'="PM"))
The field value settings don't make a difference, and the fields that are created new with 1.) or 2.) cannot be filtered for "1"s or 0"s, so something must be wrong with the field calculation I guess. Does anybody know what I need to change to make it work? Are there special rules for formulas in pivot tables that apply to formula 1.) and 2.) to make them work?
Thanks for any help on this
I think the limitation is not you, but Excel.
See here for description of what is possible, as well as this question
I tried your code and indeed I see it's not working. Even with a simple if code it doesn't seem to work. I think it's is explicitly called a calculated field because you are only able to calculate the fields in the Sum/Total/Count etc. column.
Have a look at MS, this function is quite limited.
I would try to make another work-around to accomplish your goal.
Microsoft

Error in Calculated Column (using Today) in DataSheet View - Sharepoint 2010

I have calulated column which display's the value based on the difference between today and requested date field.
=Today-[Requested Date]
This is working fine in Sharepoint Standard View. But the same is not working with the datasheet view . The calculated column is showing as below
=#NAME?-[Requested Date].
Due to this i am not able to save the data. Can anyone please let me know how to solve this ?
Which SharePoint version are you using?
I tried the same scenario using SharePoint 2013 and was able to add the values in both standard and datasheet views. I am assuming you might have used the same steps.
Create 2 new columns named RequestedDate(DateTime) and
Today(Single line of text).
Add a new column of type calculated field with formula
=Today-[Requested Date].
Now delete the Today column.
Try entering the data in both the views.
First I have used today() function to calculate difference between 2 days except working days. The list is not automatically updating. If we change the Start_Date, then it calculates and gives the value. Can you suggest me why this happens?
You have mentioned in your post that there is some tricks in using today() function. I have created separate Today_Date column in my list. And Used the same column name in finding difference between 2 days. Here also the same problem exists.
The formula I used is,
=IF(AND((WEEKDAY([Today Date],2))<(WEEKDAY([Release Date],2)),((WEEKDAY([Release Date],2))-(WEEKDAY([Today Date],2)))>1),(((DATEDIF([Release Date],[Today Date],"D")+1))-(FLOOR((DATEDIF([Release Date],[Today Date],"D")+1)/7,1)*2)-2),(((DATEDIF([Release Date],[Today Date],"D")+1))-(FLOOR((DATEDIF([Release Date],[Today Date],"D")+1)/7,1)*2)))
Please tell me how to make the difference between 2 date values update automatically every time I open the list.
Then I tried the trick which you have mentioned above. But it works while I enter the data. When I open the list for the next day or some other day's after the Calculated column is not taking the current day's value, do the data remains same. what should I need to do in case it needs to take current date's value and calculate the formula?

Resources