Excel formula that checks the text of a specific column and the text of a specific row and returns the data listed in the table - if-statement

I am trying to display the outcome scores on one Excel sheet into another Excel sheet based on the outcome name and course.
If the text in Sheet1!C2=communication and Sheet1!E2=Comm 2010, then display Sheet1!D2 on Sheet2!B3.
If the text in Sheet1!C4=information* and Sheet1!E4=Commm 3000, then display Sheet1!1D4 on Sheet2!C5.
Need to be able to use Wildcard when checking the text.
If the text in Sheet1!C6=communication and Sheet1!E6=Comm2010, but there is no number in Sheet1!D6, leave Sheet2!B5 blank
I have played around with a few different IF AND formulas, but I can't get the data displayed correctly.
Right now, I am building a pivot table from the data in Sheet1, then taking the table and formatting it to match the table on Sheet1 then using =IF(Pivot!C7="","",Pivot!C7). This works, but building a pivot table for each student and then formatting it to match Sheet1 is a time drain.
I'm really hoping there is a better way to do this.
Thank you!

Since you are compiling outcomes on a per-student basis and not in total it is safe to use the SUMPRODUCT() function:
The formula below is used in B3
=SUMPRODUCT((Sheet1!$E$2:$E$6=Sheet2!B$1)*(Sheet1!$C$2:$C$6=Sheet2!$A3)*(Sheet1!$D$2:$D$6))
and can be copied across and down throughout B3:C4
The formula used in B5 is different, because of the 'wildcard criterion'
=SUMPRODUCT((Sheet1!$E$2:$E$6=Sheet2!B$1)*(LEFT(Sheet1!$C$2:$C$6,11)="Information")*(Sheet1!$D$2:$D$6))
(unless you are using Microsoft 365, having the formula directly suppress 0 values essentially entails doubling it in length so, as an alternative, given the small output range, a custom-number format has been implemented, which effectively doesn't display 0 in a cell where that is the formula result)

Related

How can I cleanly order data in the desired sequence within Power BI Visualizations? (Line and Stacked Column Chart)

I am working on a report that displays monthly data most of which are represented in the following format, XX+YY (IE 01+11,02+10,03+09, etc.). The first set of digits reflect the represented month, so these naturally order themselves in sequence.
Image of visual with correct sequence
However, I must also include the financial plan for the year is in the format "FYXX Plan" where XX is the last two digits of the calendar year. When sorting text Power BI orders leading numbers before leading letters, so this moves the plan column to the END of the data set instead of where it logically belongs at the FRONT.
Image of visual with incorrect sequence
Is it possible to re-order my visual to still show the XX+YY monthly data in ascending order, but to move the FYXX Plan data to be the first column shown?
Very respectfully,
Jon J.
You could add a new column for sorting, stripping out the 'FY' when it exists e.g.
SortColumn = IFERROR(mid(Sorting[Date],find("FY",Sorting[Date])+2,10),Sorting[Date])
(For any value which includes 'FY' the mid function will show the remaining characters, if FY is not found it will error, and give the full date, there are a number of ways to achieve this using e.g. IF statements etc.
You can either replace the axis with this column, if you really need it to display as 'FYxx' you could set First(SortColumn) as the tooltip text to allow you to sort by that instead.

How to alternate values of a =textjoin range in spreadsheets

first of all excuse my poor English, I'm trying to get the exact words to summarize my problem.
I'm trying to make a formula to concatenate a big range of cells by alternating its crossed values.
If you see the image, I have some titles (3rd row), and some variable values for each column from B to D, in the rows 5 to 7. The number of columns and rows will expand in actual project. Then, I need to summarize all crossed data to make some processes later: I need the output written at column F, where I get the title and then the cell value.
If I use =TEXTJOIN(",";;"$B$3:$D$3;B5:D5) I get the output at H5, but It makes me to get many problems later at processing information.
I have tried to make some extra columns or cells concatenating content of each "title" and "value", and then, joining everything, but it's a poor solution if I'm trying to build a sheet with hundreds of columns. I'm sure there would be another better solution, but I can't figure out by now.
your formula should be:
=ARRAYFORMULA(SUBSTITUTE(REGEXREPLACE(TRANSPOSE(QUERY(TRANSPOSE(
IF(B5:D<>"", ","&B3:D3&","&B5:D, )),,999^99)), "^,", ), " ,", ","))

Calculating median on a excel file

I want to calculate the medians for a series of numbers from an excel file.
My excel spreadsheet looks like this:
CELLNOUN 9.32
CELLNOUN 10.62
CELLNOUN 8.42
CELLNOUN 10.64
CELLNOUN 11.51
CELLNOUN 12.01
CELLNOUN 8.83
CELLSNOUN/CELLNOUN 9.53
CELLSNOUN/CELLNOUN 9.21
CELLNOUN/CELLSNOUN 10.76
CELLNOUN/CELLSNOUN 7.01
CELLSNOUN/CELLNOUN 10.21
PLANTNOUN/PLANTSNOUN 3.62
PLANTNOUN/PLANTSNOUN 3.38
PLANTSNOUN/PLANTNOUN 3.92
PLANTSNOUN/PLANTNOUN 3.24
PLANTNOUN/PLANTSNOUN 3.83
PLANTNOUN/PLANTSNOUN 3.24
PLANTSNOUN/PLANTNOUN 3.00
PLANTSNOUN/PLANTNOUN 1.80
...
In the spreadsheet, each set of words has been separated by a blank row, but the numbers of the entries for each set varies, like CELLNOUN/CELLSNOUN has 12 entries but PLANTNOUN/ has 8 entries. The numbers coming after the words are, in fact, the occurrences of these words. I want to find out the median of the occurrences for CELLNOUN/CELLSNOUN, PLANTNOUN/PLANTSNOUN etc, by using Regex instead of using the MEDIAN function in Excel to do it, because I have thousands of sets like this and I can't do it one by one on Excel. But if you know a quicker way to do it on Excel, please advice.
Thank you very much.
First of all, remove the blank rows from your data set and then create an Excel Table with Insert > Table or Ctrl-T. With an Excel table object, all functions and commands that refer to the table will catch when more data is added to the table.
Now you can create a pivot table from your source data with Insert > PivotTable. If you drag the first column field into the rows area, you will have a list of unique values in that source data column. You can drag the values column into the Values area of the Pivot Panel, if you want to. This should now look similar to this screenshot:
I'm not sure if you are aware of the different spellings of your categories, i.e. with or without an "S". The pivot table uncovers them all.
Out of the box, Excel PivotTables do not offer the Median as an option to aggregate, but you can use a method outlined here
http://www.myonlinetraininghub.com/calculating-median-in-pivottables
to calculate a median.
The exact approach varies depending on whether or not you use Pivot tables or Power Pivot, so check out the article.
Use an array formula as shown below and press ctrl+shift+enter to make it an array formula:
=MEDIAN((IF($A$1:$A$20=A1,$B$1:$B$20)))
Refer to the formula bar in the image below to apply to all cells by applying the same formula to all cells

Excel columns made up of different merged cells

I'm trying to tidy up a sheet with the following problem, and would appreciate any advice.
My sheet has 7 "master columns" and about 4000 rows. It was compiled by converting a load of PDF documents.
The master columns are made up of merged minor columns, but at various parts of the data, the minor columns that make up each master column are different.
eg The first master column is made up of merged columns A-H for the first 30 rows, but for the next 25 rows it's made up of merged columns A-G etc.
As I said, overall there are still the same 7 master columns from top to bottom, but the merging is different throughout...
Can anyone think of a way to fix this without doing it all manually?
Copy your horrible spreadsheet into Word with Home > Clipboard – Paste, Paste Special, Unformatted Text and replace ^t^t with ^t. Replace All repeatedly, until Word has completed its search of the document and has made 0 replacements. Copy back in to Excel.
This is not tested on your image so there might be some issues – perhaps column misalignments (where even Word’s limited regex may help to add back tabs where suitable). The result should be no merged cells – mind you someone on SE described these along the lines of “A creation of the Devil to test us beyond endurance” (ie best avoided).
Try selecting the full document and click unmerge button from the ribbon.
As per the screen shot you provided, you can select all and unmerge but getting the corresponding fields in order might be challenging.
Try using macros to set combined functionalities in a single or combine key presses

How to sum entries that have same ID OpenOffice - Calc

I have a spreadsheet similar to the one in the screenshot.
From this I want to sum all the entries in Data 2 which have the same Data 1 ID and store it in another column. So something like this:
I am not able to figure out the formula which would do this. I figured out how to get a column with unique entries I just need to figure out how to get the sum of the values which have the same data 1 id.
Can someone point me in the right direction?
You can use SUMIF, e.g. if I'm reading your sheet right, =SUMIF(A$2:A$7, A11, B$2:B$7), and then copy down. This sums the values from B2-B7 whenever the corresponding value in A2-A7 matches A11.
You can find more on SUMIF here.
you may use subtotals function under the Data tab, although it gives you the answer in the row below all the cell matching your id; then you have to click the - and + buttons that appear on the left...you may see these in this picture of my data
this is a nice resource when you have non-English characters(á, ó, ß,...), spaces, dashes and points, so it becomes difficult to process with sql